File Url Cross Domain Issue in Chrome- Unexpected

后端 未结 1 1208
不知归路
不知归路 2020-11-28 13:38

The issue is about Chrome throwing Cross Domain Error on using file url

I am embedding a svg document into a HTML using the object tag with the data attribute in the

相关标签:
1条回答
  • 2020-11-28 14:14

    You are hitting the cross domain/file security limitations of Chrome.

    You can, disable this by following the instructions in Disable same origin policy in Chrome and details in How can access and the origin policy in chrome as I'm not using a server on how to start Chrome with these turned off.

    A word of warning, though: they are called "security limitations" for a reason so do not go applying this when browsing 3rd party sites. This is extremely dangerous to turn off whilst browsing the web normally. For example, with this turned off I can now make requests on your behalf to sites like gmail.com, facebook.com and yourbank.com, and your cookies will be set allowing me to masquerade as yourself.

    If you still really need this, you need to run chrome with the --disable-web-security flag:

    chrome --disable-web-security # unix/linux only
    

    If you need cross OS instructions on how to apply the flag, see http://www.chromium.org/developers/how-tos/run-chromium-with-flags.

    0 讨论(0)
提交回复
热议问题