简体   繁体   中英

Chrome: Disable same origin policy for localhost

I'm developing a phonegap/cordova app, it is not bound by same origin policy for the sites I care about. I use the chrome browser for fast development, which I cannot do if it is bound by same origin policy. There is a great 3 year old answer on how to completely disable the cross origin policy. But having a browser opened with completely disabled web security seem like a recipe for disaster.

Since the anser is 3 years old I'm hoping there might now be a way to disable same origin policy on a per URL basis. Either that all webpages at localhost is fine to use cross origin or that it's always okay to request data from www.example.com and www.otherexample.com?

You can use fiddler, one of it's auoto responder options is to fake cors respnce, omong many more. I use it quite a bit. It can alsow fake an api responce with a local file, i find it quite invaluable when developing frontend before backand is ready.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM