-
Notifications
You must be signed in to change notification settings - Fork 53
Tutorial: Cross Platform
The "vanilla" freedom.js that you see in this repository is intended to run in any modern HTML5-compliant browser. It depends heavily on web workers, but those now have fairly broad support. So really, all you need to do to work across browsers (and thus platforms) is deploy your content as a static website somewhere (more on publishing modules).
But these days, JavaScript doesn't just run in web pages - what if you want to make a browser extension, or an application that runs on a server? These different environments often have different primitives, scopes, or internal APIs. freedom.js handles all this for you, but it requires using a different "flavor" of freedom.js. From a usage perspective this shouldn't change much - the same freedom.js core interfaces are exposed and the same model of isolation and communication between workers is maintained.
The available "flavors" of freedom.js are:
- freedom-for-chrome: freedom.js for Chrome apps
- freedom-for-firefox: freedom.js for Firefox extensions (this will change as Firefox moves away from their JavaScript module approach, and hopefully unify with Chrome)
- freedom-for-node: freedom.js for node applications
All of these repositories have their own documentation to help you get started, and the same general freedom.js development practices documented in this wiki also still apply. Also note that, while we strive to smooth over all the bumps between different environments, at times there may still be some subtle differences. If you encounter something that you think is a bug, please file an issue in our corresponding repo - thanks!