Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I disabled websecurity in google chrome from command prompt by the following command
start "chrome" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --allow-file-access-from-files --disable-web-security ..
It worked for me..
But every time i need to run the command prompt .So i want to make this the default behavior without having to open a terminal/command line or a custom shortcut every time.
Posted
Updated 15-Oct-14 1:29am
v3

1 solution

You don't.

The whole point of the security features is to prevent javascript from performing dangerous actions. If there was a way to disable it through javascript, then it wouldn't provide any protection at all.
 
Share this answer
 
Comments
Lavanya Jujjavarapu 15-Oct-14 8:44am    
It's a requirement for us to access local xml files through google chrome
Richard Deeming 15-Oct-14 8:46am    
Then you'll have to ask your users to run Chrome using a custom shortcut.

Browser makers aren't going to reduce the security of their products just because someone has a requirement to circumvent the security.
Lavanya Jujjavarapu 15-Oct-14 8:59am    
I made a custom chrome shortcut by appending target path to below args
"--allow-file-access-from-files --disable-web-security".It works fine.But i want to disable websecurity through custom java script code .is it possible?..
Richard Deeming 15-Oct-14 9:01am    
As I told you in my answer: No, it is not possible.

Javascript code cannot disable security restrictions placed on javascript code by the browser, for obvious reasons.
Lavanya Jujjavarapu 15-Oct-14 9:02am    
ok.Thank you for giving me reply

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900