Chrome cross-domain settings

Source: Internet
Author: User

Recently in the learning angular route, using the version 54.0 Chrome to run the HTML in the sample, there was a ban on cross-domain phenomena, as follows:

Google the next solution, reproduced as follows, the original address: http://www.cnblogs.com/cshi/p/5660039.html

When the WebApp is developed, it is often necessary to set the browser to support cross-domain mode for some reason, but the Chrome browser supports cross-domain settings, and there are many chrome cross-domain Setup tutorials on the web. But the new version of Chrome has raised the threshold for cross-domain settings, and the original method no longer applies. The following is a brief introduction to the new version of Chrome's cross-domain setting method.

Cross-domain settings prior to version number 49

First introduce the old method, refer to some online tutorials, in fact, directly on the Open command to add--disable-web-security on it.

Specific practices are:

1. After downloading and installing the Chorme browser, locate the browser shortcut icon on the desktop and click the right mouse button's property column.
2. Add--disable-web-security to the target input box in the Properties page as shown:

3. Click Apply and OK to close the Properties page and open the Chrome browser. If the browser prompts "you are using an unsupported command tag--disable-web-security", the configuration is successful.

Chrome cross-domain settings after version number 49

After the version of Chrome has risen to 49, the cross-domain setting is stricter than before, and a directory of new user personal information needs to be given after the--disable-web-security is added to the command. It is well known that Chrome is a browser that needs to be signed in with a Gmail address, which will generate a directory where personal information is stored and personal information such as a user's collection, history, and so on. After version 49, if you set up a Chrome browser to support cross-domain mode, you need to specify a personal information directory, not the default directory, it is estimated that Chrome browser is afraid that users do not use cross-domain mode to disclose their personal information (mainly cookies, Many websites ' login token information is stored in a cookie.

Specific practices are:

1. Create a new directory on your computer, for example: C:\MyChromeDevUserData

2. Add the--disable-web-security--user-data-dir=c:\mychromedevuserdata,--user-data-dir value in the target input box in the Properties page to the new directory you just created.

3. Click Apply and OK to close the Properties page and open the Chrome browser.

Open Chrome again and find "--disable-web-security" related hints that chrome can work across domains again.

After the success of the cross-domain, the first page was replaced by Google's welcome pages, while the original collection of links and history are missing, and the C:\MyChromeDevUserData directory generates new personal information related files.

Reference:

Chrome cross-domain settings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.