Linux command
web-ext 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Run extension in Firefox
web-ext run
Run in specific Firefox
web-ext run --firefox=[/path/to/firefox]
Build extension
web-ext build
Lint extension
web-ext lint
Sign extension
web-ext sign --api-key=[key] --api-secret=[secret]
Run from specific directory
web-ext run -s [extension/]
Run with verbose output
web-ext run -v
说明
web-ext is Mozilla's official command-line tool for developing, testing, and publishing Firefox WebExtensions. It streamlines the extension development workflow by providing commands for running, building, linting, and signing extensions. The run command launches Firefox with the extension temporarily loaded and automatically reloads it when source files change, enabling rapid development iteration. The build command packages the extension into a .zip file ready for submission to addons.mozilla.org (AMO), and the lint command checks for common issues like manifest errors and deprecated API usage. The sign command submits the extension to Mozilla for signing, which is required for distribution outside AMO. Authentication requires an AMO API key and secret obtained from the Firefox developer portal.
参数
- run
- Run in browser.
- build
- Package extension.
- lint
- Check for issues.
- sign
- Sign for distribution.
- -s, --source-dir _DIR_
- Extension source.
- --firefox _PATH_
- Firefox binary.
- -v, --verbose
- Verbose output.
- --api-key _KEY_
- AMO API key.
- --api-secret _SECRET_
- AMO API secret.
FAQ
What is the web-ext command used for?
web-ext is Mozilla's official command-line tool for developing, testing, and publishing Firefox WebExtensions. It streamlines the extension development workflow by providing commands for running, building, linting, and signing extensions. The run command launches Firefox with the extension temporarily loaded and automatically reloads it when source files change, enabling rapid development iteration. The build command packages the extension into a .zip file ready for submission to addons.mozilla.org (AMO), and the lint command checks for common issues like manifest errors and deprecated API usage. The sign command submits the extension to Mozilla for signing, which is required for distribution outside AMO. Authentication requires an AMO API key and secret obtained from the Firefox developer portal.
How do I run a basic web-ext example?
Run `web-ext run` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does run do in web-ext?
Run in browser.