在尝试跨脚本编写iframe时,如何禁用拒绝访问的消息? [英] How do I disable the access denied message when trying to do cross scripting into an iframe?

查看:95
本文介绍了在尝试跨脚本编写iframe时,如何禁用拒绝访问的消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个指向网站的iframe即。

I have an iframe that points to a website ie.

<iframe src='http://www.fish.com/' id='fish'>

我的本​​地电脑上有一个html尝试点击iframe中的按钮:

I have a html on my local pc that tries to click a button in the iframe:

alert ( $('#fish').contents().find('#myButton').length );

我在浏览器中启用了跨站点脚本,并将安全性降低到最大值。我仍然得到访问被拒绝的错误。我曾尝试过IE6,IE8和Firefox。如何删除此限制?我试图测试一些东西,并了解风险等。

I have enabled cross site scripting in my browser and lowered security to the max. I still get access denied errors. I have tried in IE6, IE8, and Firefox. How can I remove this restriction? I am trying to test something, and understand the risks etc.

这是一个例子:

http://jsfiddle.net/RSbja/

使用上面的确切代码。

推荐答案

Firefox 需要选项 signed.applets .codebase_principal_support 设置为 true (about:config)。

Firefox needs the option signed.applets.codebase_principal_support set to true (about:config).

Chrome 需要开始使用 - disable-web-security

IE 需要选项允许跨域访问(...) 额外 - >安全性

这些选项将禁用XHR对象上跨域访问的安全检查iframes。

Those options will disable the security check for cross-domain access on XHR objects and iframes.

这篇关于在尝试跨脚本编写iframe时,如何禁用拒绝访问的消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆