Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support older browsers; string deserialisation broken on Firefox < 30 #32

Closed
tuukka opened this issue Oct 30, 2015 · 2 comments
Closed

Comments

@tuukka
Copy link
Contributor

tuukka commented Oct 30, 2015

We would need support for older browsers, which are not supported by buffer.js. There's better support e.g. in the buffer package in npm. Could pbf use that instead of buffer.js?

The concrete issue with Firefox < 30 is that toString cannot be overridden by buffer.js, resulting in all strings deserialising as "[object Uint8Array]" instead of the actual data.

Another browser supported by buffer but not buffer.js is IE9.

@mourner
Copy link
Member

mourner commented Dec 23, 2015

I made buffer.js instead of buffer because of some performance optimizations tailored specifically for pbf, and to make the build as lightweight as possible. Not sure if it's worth supporting old browsers in this library. As a workaround, you can put a compatible Buffer into a global scope, and it will be used instead: https://github.com/mapbox/pbf/blob/master/index.js#L5

@mourner
Copy link
Member

mourner commented May 27, 2016

Based on the browser version usage stats, I don't think it's worth significantly complicating the code to support unused legacy versions like this. E.g. IE9's usage is 0.51%. And there's a workaround above for those who need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants