rtfeldman / seamless-immutable

Immutable data structures for JavaScript which are backwards-compatible with normal JS Arrays and Objects.
BSD 3-Clause "New" or "Revised" License
5.37k stars 194 forks source link

Support for Mozilla Addons #155

Closed qzb closed 7 years ago

qzb commented 7 years ago

Seamless-immutable doesn't work properly with Firefox addons, because it requires global process object which is not available inside addon environment. This applies to both web-extensions and jetpack-based addons. In case of web-extensions it is possible make polyfill for process object, but it is not possible with jetpack (at least without using custom modules loader).

I've fixed this issue by checking if process object exists before using it.

rtfeldman commented 7 years ago

@qzb that's only in there so that the development and production builds can be built using envify - once the builds are complete, that variable will be gone.

If you use either the development build or the production build, process should not be there, and you should be all set! 😃