我使用 create-react-app 来创建新的反应应用程序。除了在launch.json中添加配置“Chrome-launch”之外,我没有任何改变。调试启动后,它总是需要一些授权。根据我添加到 manifest.json 的 chrome.debugger 文档:
"permissions": [ "debugger"]
但这并没有帮助。现在我不知道如何通过它。拜托,有人可以给我一个提示如何在没有任何授权的情况下启动 chrome-debugger 吗?我过去多次使用过这个调试器,它从来不需要授权,我不知道发生了什么变化。
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
清单.json:
{
"short_name": "React App",
"name": "Create React App Sample",
"permissions": [
"debugger"
],
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
包.json:
{
"name": "kinosal",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-scripts": "3.1.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}