This project aims to generate Haxe externs for writing WebExtensions compatible with Mozilla Firefox (and Chrome). It uses the browser vendors' own json api specification files to do so.
A Haxe installation is needed.
Just clone this git and run haxelib install build.hxml
That should install all the necessary libraries.
The usage depends on whether you want to generate the Firefox or Chrome Extension APIs:
- Go to https://hg.mozilla.org/mozilla-unified/tags, choose the version of Firefox you want externs for, then navigate to /browser/components/extensions/schemas/ and /toolkit/components/extensions/schemas
- Download them (as a zip) and put the files (unpacked) into the "firefox_schemas" folder within this project.
- Run the generator using
./generate_firefox.sh
- The output can be found in "firefox_output"
- Go to https://chromium.googlesource.com/chromium/src/+refs, choose the version of Crhome you want externs for, then navigate to /chrome/common/extensions/api/ and /extensions/common/api
- Download them (as a tgz) and put the files (unpacked) into the "chrome_schemas" folder within this project.
- Run the generator using
./generate_chrome.sh
- The output can be found in "chrome_output"
- Probably only needs more testing of the actual APIs
- Write a wrapper around the apis for easy portability