Navigate to "about:debugging" in the browser.
Click "Load Temporary Add-On".
Select any file in the extension's directory.
- the extension will stay until you restart the browser
You may also need to:
- Tools > Options > Extensions & Themes > Extensions > select this test extension ... Manage > Details > Allow to Run in Private Windows
Content scripts (injected into web pages) can be debugged with the normal developer tools.
To open the settings/options page for an extension:
- Tools > Options > Extensions & Themes > Extensions > select this test extension ... Options
To use the Console and Inspector to debug the extension Options page:
- about:debugging > This Firefox > Inspect
Note that browser.storage.local does not save to Local Storage.
content_scripts are loaded into each webpage that is loaded and matches the specified url pattern.
[WebExtension APIs accessible in content_scripts]
content_scripts do not have access to all WebExtension APIs. For instance, they cannot access bookmarks.
Background scripts are loaded when the extension is loaded.
Background scripts can access all WebExtension APIs.
To debug background scripts:
- about:debugging > This Firefox > Inspect > Debugger > expand Sources to find the script
- then click the boxy-icon and select "Show Split Console"