Front-end notes----Chrome browser cannot access cross-domain solutions

1. Demand scenarios

  1. When Chrome browser develops H5 for interface joint debugging, the browser does not allow cross-domain access;
  2. If you want to use browser settings, do not use a proxy, etc., the browser can perform cross-domain access.

2. Error picture

insert image description here

3. Solutions

3.1 Obtain the installation location of Chrome browser

insert image description here

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

insert image description here

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

insert image description here

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! ! !

insert image description here

4. Summary

  1. Get the location where the Chrome browser is installed;
  2. Assemble the complete setup command;
  3. 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

Guess you like

Origin blog.csdn.net/m0_38082783/article/details/130139112