1. Demand scenarios
- When Chrome browser develops H5 for interface joint debugging, the browser does not allow cross-domain access;
- If you want to use browser settings, do not use a proxy, etc., the browser can perform cross-domain access.
2. Error picture
3. Solutions
3.1 Obtain the installation location of Chrome browser
3.2 Setting allows cross-domain and non-verification certificates
--user-data-dir="C://Chrome dev session" --disable-web-security --test-type --ignore-certificate-errors
3.3 cmd executes the setting command
3.4 Compose a complete command
C:\Users\Rattenking\AppData\Local\Google\Chrome\Application\chrome.exe --user-data-dir="C://Chrome dev session" --disable-web-security --test-type --ignore-certificate-errors
3.5 cmd run command
3.6 After the command is executed, a new browser window will be opened
Copy the previously visited address to the newly opened Chrome browser window! ! !
4. Summary
- Get the location where the Chrome browser is installed;
- Assemble the complete setup command;
- Execute the command to set cross-domain access.
C:\Users\Rattenking\AppData\Local\Google\Chrome\Application\chrome.exe --user-data-dir="C://Chrome dev session" --disable-web-security --test-type --ignore-certificate-errors