gpt4 book ai didi

reactjs - 从 vscode 调试启动时,如何让 Firefox 正确恢复其状态?

转载 作者:行者123 更新时间:2023-12-04 15:23:27 25 4
gpt4 key购买 nike

对于我的 React webapp,我有一个启动配置来启动 Chrome 或 Firefox 进行调试。两者都工作得很好,除了 Firefox 在调试启动后不会恢复其先前的设置(或者它甚至不保存它们)。
当我启动 Chrome 时,它​​会记住浏览器的大小和位置,并且我接受了本地主机的自签名证书。
Firefox 不会做任何事情。启动后,我总是必须重新定位窗口并再次接受自签名证书,随着时间的推移,这真的很烦人。
这是我的启动设置:

{
"version": "0.2.0",
"configurations": [
{
"type": "firefox",
"request": "launch",
"reAttach": true,
"name": "Launch MSG on FF",
"url": "https://localhost:3001",
"webRoot": "${workspaceFolder}/src",
"clearConsoleOnReload": true,
"preLaunchTask": "tsc: watch"
},
{
"type": "chrome",
"request": "launch",
"name": "Launch MSG on Chrome",
"url": "https://localhost:3001",
"webRoot": "${workspaceFolder}/src",
"userDataDir": "${workspaceRoot}/.vscode/chrome",
"sourceMaps": true,
"preLaunchTask": "tsc: watch",
"sourceMapPathOverrides": {
"webpack:///build/*": "${webRoot}/*"
}
},
{
"type": "node",
"name": "Run Tests",
"request": "launch",
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
"args": [
"--config ${workspaceFolder}/jest.config.js"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true
}
]
}
需要更改什么才能使 FF 在从 vscode 调试时也保持最后状态?
以防万一这很重要:我在 macOS 上,调试实例的 FF 配置文件文件夹在 /var/folders/03/... 中(并且该文件夹存在且可写)。

最佳答案

您正在寻找以下标志:

keepProfileChanges : true
此外,您可以使用以下方法指定配置文件:
profile : "dev"
而且,只是额外的一点,您可以使用以下方法自动打开开发工具:
firefoxArgs : [
-devtools
]
为简洁起见:
"configurations": [
{
"type": "firefox",
"request": "launch",
"reAttach": true,
"name": "Launch Name",
"clearConsoleOnReload": true,
"keepProfileChanges": true,
"profile": "dev",
"firefoxArgs": [
"-devtools",
]
]
如果您需要用于创建配置文件的资源: ref
火狐 CLI ref

关于reactjs - 从 vscode 调试启动时,如何让 Firefox 正确恢复其状态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62829324/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com