Tool environment: use vs code to debug chrome in layui framework
Problem Description: when Chrome browser calls other pages with iframe page, it will prompt: “uncaught domexception: blocked a frame with origin” null “from accessing a cross origin frame”
But there is no problem with IE and edge
Reason: Chrome thinks it is not secure across domains
Solution: add configuration in launch.json
,”runtimeArgs”: [
” –disable-web-security”
]
The complete configuration file is as follows:
1 "version": "0.2.0",
2 "configurations": [
3 {
4 "name": "Debugging with native Chrome",
5 "type": "chrome",
6 "request": "launch",
7 "file": "${workspaceRoot}/index.html",
8 //"url": "http://mysite.com/index.html", //When using an external server, please comment out the file, use the url instead, and set useBuildInServer to false "http://mysite.com/index.html
9 "runtimeExecutable": "C:\\Program Files (x86)\Google\\Chrome\\Application\\chrome.exe", // change it to your Chrome installation path
10 "sourceMaps": false,
11 "webRoot": "${workspaceRoot}",
12 // "preLaunchTask":"build",
13 "userDataDir":"${tmpdir}",
14 "port":5433
15 ,"runtimeArgs": [
16 " --disable-web-security" //Cross-domain access, insecure, local testing only
17 ]
18 }
19 ]
Similar Posts:
- Iframe Cross-port Blocked a frame with origin from accessing a cross-origin frame
- Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extensi…
- [How to Solve] Eclipse: Errors occurred during the build
- When eclipse writes CPP, symbol “cout” could not resolved appears
- Solution to the problem of missing URI path in chrome 85 + referer
- PHP use$_ SERVER[‘PHP_ Self ‘] to get the current page address and its security issues
- [Chrome Error] Cross origin requests are only supported for protocol schemes: http, data,chrome-extension
- [Solved] Hbase Startup Normally but Execute Error: Server is not running yet
- [Solved] NetworkError: Failed to execute ‘send’ on ‘XMLHttpRequest’: Failed to load xxxx
- Access to XMLHttpRequest at ‘http://localhost:9990/’ from origin ‘http://IP:Port’ has been blocked by CORS policy…more-private address space `local`