How can access and the origin policy in chrome as I'm not using a server

我与影子孤独终老i 提交于 2019-12-31 03:51:31

问题


I want to change the origin policy in chrome, how can I access it and modify it?

Many thanks


回答1:


Are you talking about relaxing the same origin policy for file:/// urls? If so, I strongly recommend you set up a web server on your local machine and develop that way.

That said, you can run Chrome with this command line flag: --allow-file-access-from-files This will make all file:/// urls run in the same origin. The downside: any .html page you download and open could possibly open any file on your system and upload it to some server without you knowing. So you need to be more careful if you're doing this.

Besides file:/// urls you cannot change the same origin policy outside of APIs like CORS.



来源:https://stackoverflow.com/questions/4409901/how-can-access-and-the-origin-policy-in-chrome-as-im-not-using-a-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!