Chrome - browser cross-domain access settings (Attachment: old and new versions of two settings)

Separation before and after performing webapp development, or when H5 mobile App development, we will use the PC browser development and debugging. However, by default Ajax request can not be cross-domain access, the following error will be reported when requested: 

XMLHttpRequest cannot load http://127.0.0.1:8080/ptmo/services/ptmo/v1/execOneSql. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8020' is therefore not allowed access.

Original: Chrome - browser cross-domain access settings (Attachment: old and new versions of two settings)

 

Here's how it supports cross-domain by setting Chrome. Since the new version of the setting method and not the same, the following were introduced.

 

First, set up cross-domain version of the old browser (version 49 before)

(1) Right-click on Chrome shortcut icon, select "Properties."

(2) the target input box property page Appends: --disable-web-security

Original: Chrome - browser cross-domain access settings (Attachment: old and new versions of two settings)

(3) Click "Apply" and close the properties page. Reopen the chrome browser. If the browser displays "you are using an unsupported command tag --disable-web-security", then the configuration was successful.

Original: Chrome - browser cross-domain access settings (Attachment: old and new versions of two settings)

Second, the cross-domain set up the new browser (version 49 onwards)

(1) Create a directory on your computer, for example: C: \ MyChromeDevUserData

(2) the target input box in the property page add: --disable-web-security --user-data-dir = C: \ MyChromeDevUserData

Original: Chrome - browser cross-domain access settings (Attachment: old and new versions of two settings)

(3) Click Apply and OK to close the Properties page, and open the chrome browser. Found "--disable-web-security" related tips, instructions chrome can be a normal cross-domain work.


From the original: www.hangge.com   reproduced please retain the original link: http://www.hangge.com/blog/cache/detail_1703.html

Guess you like

Origin www.cnblogs.com/turnip/p/12195137.html