Chrome browser cross-domain and security access issues using Chrome's command line tag: disable-web-security parameter inline data

Source: Internet
Author: User

Do front-end, with Ajax to get data, is often the case, the same domain naturally no problem, if it is different domain to obtain data, the browser has a homologous policy restrictions.

Origin * isn't allowed by access-control-allow-origin

Some people will say with JSONP. If the data interface in the background only returns pure JSON data, it is not possible to modify the data form that conforms to JSONP. What shall we do at this time? If your browser is chrome, then there's the gospel. After opening the address of Chrome --args --disable-web-security , you can block secure access [--args: This parameter is optional], and then randomly invoke the data under different domains.

The following are the steps:

One: Chrome under Windows System (WIN7)

1. Close all open chrome. ( important ). Otherwise, there will be no effect!

2, create a shortcut to Chrome, the goal of modifying the shortcut is:

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

3. Double-click the Chrome shortcut we created to open chrome and " you're using an unsupported command line tag:--disable-web-security." Stability and security will decrease ", indicating that you have canceled the cross-domain limit, and you can call data across domains arbitrarily.

Mac OS under

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

Or

Open-a "Google Chrome"--args--disable-web-securityubuntu? Linux:

Chromium-browser--disable-web-security Open the Apple Safafi with the command line: (Mac OS)

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

Chrome browser cross-domain and security access issues using Chrome's command line tag: disable-web-security parameter inline data

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.