Using the chrome command line tag: disable-web-security parameter inline data----------Chrome browser Cross-domain and secure access issues __chrome

Source: Internet
Author: User
Tags unsupported
There is a problem
Do the front-end, using AJAX to get data, is often the case, the same domain naturally no problem, if it is different domain access to data, browsers have a homologous policy restrictions.

As shown in figure:

XMLHttpRequest Cannot load Origin * is not allowed by Access-control-allow-origin
Some would say it's jsonp. If the backend data interface simply returns simple JSON data, it cannot modify the data format that conforms to the Jsonp method. What should we do at this time? If you use a browser that is chrome, then there is the gospel. After opening the chrome address plus--args--disable-web-security can screen security access [--args: This parameter is optional], and then randomly call the data in different fields.
The specific steps are as follows: Chrome under Windows System (WIN7)

1, close all open chrome. (important). Otherwise, there will be no effect.
2, to create a chrome shortcut, modify the target of the shortcut:

"C:\Program Files\google\chrome\application\chrome.exe"--args--disable-web-security

Figure: Creating a Chrome Shortcut
3. Double-click the Chrome shortcut we created to open chrome, as shown "you are using an unsupported command line tag: –disable-web-security." Stability and security will decrease ", which means that you have canceled cross-domain restrictions, and you can call data across domains arbitrarily.
As shown in figure: you are using an unsupported command-line tag:--disable-web-security. Stability and security will decrease with the Mac OS below

/applications/google\ chrome.app/contents/macos/google\ Chrome--disable-web-security

Or

Open-a "Google Chrome"--args--disable-web-security
Ubuntu? Linux:
Chromium-browser--disable-web-security

Open the Apple Safafi method using the command line: (under Mac OS)

Open-a '/applications/safari.app '--args--disable-web-security

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.