From f63a6bd1dab50bcb8a19a0c99f80095430d949af Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Fri, 27 Apr 2018 16:27:24 -0400 Subject: [PATCH] LP1731922 - Begin Firefox add-on development notes. Signed-off-by: Chris Sharp --- README.firefox-dev.adoc | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 README.firefox-dev.adoc diff --git a/README.firefox-dev.adoc b/README.firefox-dev.adoc new file mode 100644 index 0000000000..efd9c9886e --- /dev/null +++ b/README.firefox-dev.adoc @@ -0,0 +1,47 @@ +== Firefox Development Notes == + +Firefox can more or less run the Chrome extension as-is after +tweaking the native messenger manifest (see the differences between +org.evergreen_ils.hatch.json in extension/host/chrome/ and the same +file in extension/host/firefox/. A proof-of-concept can be achieved +by following these steps (assuming Linux): + +1. Install Java and compile Hatch as instructed in the INSTALL.adoc + file. +2. Copy the native messenger manifest to the Firefox user data directory: + +[source,sh] +---------------------------------------------------------------------------------------- +mkdir ~/.mozilla/native-messaging-hosts/ +cp extension/host/firefox/org.evergreen_ils.hatch.json ~/.mozilla/native-messaging-hosts +---------------------------------------------------------------------------------------- + Make sure to edit org.evergreen_ils.hatch.json to include the path to hatch.sh. +3. As root/sudo install web-ext: + +[source,sh] +-------------------------------------------------- +npm install -g web-ext +-------------------------------------------------- +4. Change directory to extension/app and run web-ext, which will open a new, sandboxed + Firefox instance with the Hatch add-on running: + +[source,sh] +-------------------------------------------------- +cd extension/app +web-ext run +-------------------------------------------------- +5. Navigate to about:addons, click on the gear dropdown and select "Debug Add-ons". + +6. Copy the "Extension ID" value to .mozilla/native-messaging-hosts/org.evergreen_ils.hatch.json + under "allowed_extensions". Be sure to reload ("r" in the web-ext window). + +7. Click "Debug" under the Hatch add-on listing to open the background page/console. + +8. Open the Web Console (Upper-right menu -> Web Developer -> Web Console). + +9. Follow the Hatch native app log (/home/user/.evergreen/hatch.log) in a terminal window. + +10. Now navigate in the new browser window to your Evergreen instance and proceed to set up + Hatch as normal. You should see printers appear after enabling Hatch printing and should be + able to print a page (verifying in each console/log that messages are making it from + the browser to the Hatch executable. -- 2.11.0