cocos creator使用chrome调试h5游戏,配置跨越
{"version": "1.4.0",
"configurations": [
{
"name": "Creator Debug: Launch Chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:7456?platform=gdt",
"runtimeArgs": [
"--disable-web-security",
"--user-data-dir=${workspaceRoot}\\UserDataDir",
],
"sourceMaps": true,
"userDataDir": "${workspaceRoot}/.vscode/chrome",
"diagnosticLogging": false,
"pathMapping": {
"/preview-scripts/assets": "${workspaceRoot}/temp/quick-scripts/assets",
"/": "${workspaceRoot}"
}
}
]
}
如上是vscode里面配置,添加runtimeArgs配置项,注意在cocoscreator目录下.vscode/chrome下新建UserDataDir目录
然后再F5调试运行,发现已经可以跨域调试了。
页:
[1]