Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
617 views
in Technique[技术] by (71.8m points)

Creating Google Chrome shortcut with --disable-web-security

I am trying to access some local files via jqueryMobile, it works fine in Firefox and IE but Chrome gives a security exception. I can open Chrome in disabled security mode to access local files by using

C:Program FilesChromeChrome.exe --disable-web-security

or run it via this

chrome.exe --disable-web-security

but is there any way I can create a shortcut on desktop that will always open Chrome in disabled security mode?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Just clone the shortcut for chrome you have on your desktop, and then in the shortcut properties add the parameter --disable-web-security (and --user-data-dir) at the end of chrome executable path

e.g

"C:Program FilesGoogleChromeApplicationchrome.exe" --disable-web-security --user-data-dir="C:mpChromeSession"

Edit #1 : I changed google chrome path, the old one was not correct. I just tried it on XP with fresh Chrome installed, but i got a error message that this flag is not supported.

Edit #2 : http://peter.sh/experiments/chromium-command-line-switches/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...