reactjs - 如何使用 VSCode 在 Firefox 中保留扩展并请求启动
问题描述
我正在尝试使用 React Dev Tools 和 Firefox Developer Edition 调试 React 应用程序。我无法将 React Dev Tools 安装到 Firefox 通过 VSCode 启动时使用的配置文件。当我通过在 /Applications 中打开 Firefox 自己启动 Firefox 时,我已经安装了 React Dev Tools。
但是,当我运行以下launch.json
配置文件时,启动后,Preferences -> Extensions & Themes -> Extensions in FireFox 下没有显示扩展。
{
"name": "Launch localhost",
"type": "firefox",
"request": "launch",
"reAttach": true,
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},
但是,我可以按照此处的说明使用终端启动 Firefox 并将调试器附加到它。此配置文件具有 React 开发工具,并且运行良好:
/Applications/Firefox\ Developer\ Edition.app/Contents/MacOS/firefox -start-debugger-server
启动.json:
{
"name": "Attach",
"type": "firefox",
"request": "attach",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},
但是我如何使第一个与launch
请求而不是一起工作attach
?从阅读它似乎与配置文件有关
解决方案
我遇到了同样的问题,并且能够通过添加到我的 launch.json 来解决它:
"profile": "my-firefox-profile"
Firefox 可以安装多个配置文件。您可以通过输入about:profiles
Firefox 地址栏来检查它们。它将向您显示配置文件列表。标记为的Default profile: yes
应该是可以选择的。
我的 launch.json 现在看起来像这样:
{
"name": "Firefox",
"type": "firefox",
"request": "launch",
"reAttach": true,
"url": "http://localhost:4300",
"webRoot": "${workspaceFolder}",
"profile": "default-release-1"
},
背景:
Firefox 配置文件包含浏览历史记录、书签等设置 - 最重要的是 - 附加组件。通过告诉 VSCode 使用它与已安装插件一起提供的特定配置文件。
如果您对 Angular 或 Vue 有同样的问题,这也将起作用。
推荐阅读
- ubuntu - Windows 10 上的 Ubuntu:pip 缓存文件夹不属于当前用户
- spring - spring reactive:检查用户是否存在
- r - R中的aes内的字符串常量 - ggplot2
- angular - 带有.Net核心的Angular App中的基本URL
- php - 每 10 秒运行一个 php 脚本作为 cron 作业
- javascript - ReferenceError:未定义 Gmail
- fiware - 上传数据到 HDFS Fiware Cosmos 全局实例出错
- html - Css中的相机视图角边框
- ios - 导航中的搜索栏
- mingw - 我使用命令提示符将 C:\MinGW\bin 添加到我的路径中,但过了一会儿它消失了