我已经尝试了 launch.json 和 settings.json 中的各种组合方式,包括当前,
{
"type": "firefox",
"request": "launch",
"name": "Launch Firefox Developer Edition",
"url": "C:\\xampp\\htdocs\\xyx\\index.html",
"webRoot": "${workspaceFolder}",
"firefoxExecutable": "C:\\Program Files\\Firefox Developer Edition\\firefox.exe"
},
其他浏览器启动正常。我还在settings.json中检查了
"liveServer.settings.CustomBrowser": "firefox",
,但选项只允许Value is not accepted. Valid values: "chrome", "chrome:PrivateMode", "firefox", "firefox:PrivateMode", "microsoft-edge", "blisk", null.
在 vs code 中通过 launch.json 进行调试时,如何使用 Firefox 开发版启动?
要回答我自己的问题,为了调试 Firefox 扩展,您必须使用
about:debugging#/runtime/this-firefox
中的开发人员工具工具箱中的构建。加载您的临时扩展并单击 inspect
。
https://extensionworkshop.com/documentation/develop/debugging/#developer-tools-toolbox
了解有关开始创建新扩展和调试的更多信息。
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions
https://extensionworkshop.com/documentation/develop/browser-extension-development-tools/
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_second_WebExtension