7*4 2010-06-23 15:00 采纳率: 50%
浏览 651
已采纳

在 Chrome 浏览器中禁用相同的原产地政策

Is there any way to disable the Same-origin policy on Google's Chrome browser?

This is strictly for development, not production use.

转载于:https://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome

  • 写回答

25条回答 默认 最新

  • 三生石@ 2010-07-05 07:20
    关注

    Close chrome (or chromium) and restart with the --disable-web-security argument. I just tested this and verified that I can access the contents of an iframe with src="http://google.com" embedded in a page served from "localhost" (tested under chromium 5 / ubuntu). For me the exact command was:

    Note : Kill all chrome instances before running command

    chromium-browser --disable-web-security --user-data-dir="[some directory here]"
    

    The browser will warn you that "you are using an unsupported command line" when it first opens, which you can ignore.

    From the chromium source:

    // Don't enforce the same-origin policy. (Used by people testing their sites.)
    const wchar_t kDisableWebSecurity[] = L"disable-web-security";
    

    Before Chrome 48, you could just use:

    chromium-browser --disable-web-security
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(24条)

报告相同问题?

悬赏问题

  • ¥15 fesafe材料库问题
  • ¥35 beats蓝牙耳机怎么查看日志
  • ¥15 Fluent齿轮搅油
  • ¥15 八爪鱼爬数据为什么自己停了
  • ¥15 交替优化波束形成和ris反射角使保密速率最大化
  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统