Skip to content

Test extension locally

Daniele Scasciafratte edited this page Sep 15, 2021 · 2 revisions

Info

GlotDict is packaged in a different way for Firefox then Chrome. The APIs of Firefox is more powerful and include more possibilities like the reason why they are packaged in a different way. The script package automatically for both.

Browsers

Both the browser load the extension on development in a temporary way so every settings will be removed on restarting of the browser.
To test better is ideal to have a browser profile only for that without any extension to avoid any conflict. In Firefox is more easy with Firefox Developer Edition that has a different profile and is another release.

In both the browser they have a different way to report errors, as we have only a background script we don't need to inspect hardly them and is enough to use the Browser console with a refresh of the page after the changes of the code. Every browser has a file watcher for changes and to be sure that the code is updated is better to force a refresh of the page.

The best documentation about how to develop browser extension is on https://developer.mozilla.org/en-US/Add-ons/WebExtensions that explain the difference between browser and include examples.

Firefox

https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Debugging

Chrome

https://developer.chrome.com/apps/tut_debugging

Clone this wiki locally