### Install web-ext with npm Source: https://extensionworkshop.com/documentation/develop/getting-started-with-web-ext Use this command to install the web-ext tool globally using the Node.js npm package manager. ```bash npm install --global web-ext ``` -------------------------------- ### Install web-ext with Homebrew Source: https://extensionworkshop.com/documentation/develop/getting-started-with-web-ext Use this command to install the web-ext tool if you are using Homebrew on macOS. ```bash brew install web-ext ``` -------------------------------- ### Detect Extension Installation Source: https://extensionworkshop.com/documentation/develop/onboard-upboard-offboard-users Listen for the extension's installation event using `runtime.onInstalled`. This snippet skips execution during development and opens an onboarding page upon initial installation. ```javascript browser.runtime.onInstalled.addListener(async ({ reason, temporary }) => { if (temporary) return; // skip during development switch (reason) { case "install": { const url = browser.runtime.getURL("views/installed.html"); await browser.tabs.create({ url }); // or: await browser.windows.create({ url, type: "popup", height: 600, width: 600, }); } break; // see below } }); ``` -------------------------------- ### Run with Developer Tools Source: https://extensionworkshop.com/documentation/develop/web-ext-command-reference-v7 Opens the Developer Tools for the installed extension on startup. Requires web-ext 7.3.0+ and Firefox 106+. ```bash web-ext run --devtools ``` -------------------------------- ### Example adb logcat Output Source: https://extensionworkshop.com/documentation/develop/developing-extensions-for-firefox-for-android This is an example of the output you might see when filtering `adb logcat` for add-on messages, indicating an add-on is already installed. ```log I/Gecko (30440): 1496056181889 addons.xpi WARN Addon with ID @your-addon-id already installed, older version will be disabled ```