Can I disable SOP (Same Origin Policy) on any browser for development?

前端 未结 10 1219
天涯浪人
天涯浪人 2020-11-27 14:54

I want to develop JavaScript on my Windows machine. Do you know a browser where I can turn off Same Origin Policy so I can develop locally? Firefox would be optimal

10条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-27 15:16

    All of the given answers are good ones when it comes to getting around the same origin policy in production.

    For development, there is no convenient way to "disable" this security check. There are workarounds (see other answers) or hacks (you could use Greasemonkey to wrap up the JavaScript and use their GM_xmlhttprequest as a temporary measure), but no way to actually "turn it off" as you describe.

提交回复
热议问题