三生石@ 2010-06-23 15:00 采纳率: 100%
浏览 485
已采纳

在 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

  • 写回答

26条回答 默认 最新

  • 旧行李 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
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(25条)

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记