How to allow cross domain in chrome
How to allow cross domain in chrome?
There're two ways to do it:
- --allow-file-access-from-files
- --disable-web-security
Windows
right click anywhere on your desktop, choose New > Shortcut
then type only one line in the text field as following:
- C:\Users\[USERNAME]\AppData\Local\Google\Chrome\Application\chrome.exe –allow-file-access-from-files
- C:\Users\[USERNAME]\AppData\Local\Google\Chrome\Application\chrome.exe –disable-web-security
- C:\Users\[USERNAME]\AppData\Local\Google\Chrome\Application\chrome.exe –allow-file-access-from-files –disable-web-security
then, click OK
Mac OSX
open Terminal
edit your .profile file
add this to the end of the file alias chromegwt=’/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome –disable-web-security’
save file
close Terminal window or open a new Terminal window tab then type chromegwt and you should then see Google Chrome launch without web security.
Note: you can rename it any name you want. I just used chromegwt so I would know that this Chrome is used only for GWT purposes.
Remember not to use this same browser when browsing the web as it can lead to disastrous results.
总的来说,就是在运行chrome.exe时增加“–allow-file-access-from-files” 或 “–disable-web-security”命令就可以了。
添加新评论