Opera不会加载一些JavaScript文件 [英] Opera won't load some JavaScript files
问题描述
我有一个加载在IFRAME中的网页,它可以在IE和Firefox中正常运行,但不能在Opera中运行。我讨厌哪个,因为我多年来一直是Opera用户。我写了这个东西。 : - )
I have a web page that loads in an IFRAME, that runs correctly in IE and Firefox but not in Opera. Which I hate, because I've been an Opera user for years. And I wrote this thing. :-)
问题是Opera没有加载构成页面的一些JavaScript文件。我怀疑这与页面本身是通过HTTPS加载的事实有关,而且包含的文件是通过HTTP从不同的主机和端口加载的。我相信Opera允许这样做,但Dragonfly的Net选项卡甚至没有显示加载它们的尝试。
The problem is that Opera is not loading some of the JavaScript files that comprise the page. I suspect that it is related to the fact that the page itself is loaded via HTTPS and the included files via HTTP from a different host and port. I believe Opera allows that, but Dragonfly's Net tab doesn't even show an attempt to load them.
该页面是拉力赛自定义应用,我无法控制它在IFRAME中加载或通过HTTPS加载的事实。我也无法控制包含的文件是从不同的主机加载,或者主机只支持HTTP的事实。所以我对混合内容感到困惑。
The page is a Rally "custom app", and I can't control the fact that it is loaded in an IFRAME or that it loads via HTTPS. I also can't control the fact that the included files are loaded from a different host, or that the host only supports HTTP. So I'm sorta stuck with mixed content.
除了其他内容之外,页面的HEAD元素包含(清理了一下):
Among other stuff, the page's HEAD element contains (sanitized a bit):
<script src="http://www.example.com:81/common/jquery-1.4.2.js"></script>
<script src="http://www.example.com:81/common/jsTree/jquery.jstree.js"></script>
<script src="http://www.example.com:81/common/utils_jserror.js"></script>
<script src="http://www.example.com:81/common/utils_logging.js"></script>
<script src="http://www.example.com:81/common/utils_print_r.js"></script>
<script src="http://www.example.com:81/common/utils_rally_query.js"></script>
<script src="http://www.example.com:81/common/json2.js"></script>
<script src="/slm/js/slm.js"></script>
<script src="/slm/js-lib/dojo/rally-1.3.1/dojo/dojo.js.uncompressed.js"></script>
<script src="/slm/mashup/1.18/js/batch-toolkit.js"></script>
<script src="/slm/mashup/1.18/js/utilities.js"></script>
所有的/ slm / ...内容越来越多已加载,并且无的www.example ...内容是。
ALL of the "/slm/..." stuff is getting loaded, and NONE of the "www.example..." stuff is.
任何人都知道我做错了什么?
Anybody got an idea what I'm doing wrong?
推荐答案
Opera有一项称为跨网络保护的功能。基本上它对互联网上的哪些页面可以对你本地网络上的内容做了一些额外的限制。
Opera has a feature called cross-network protection. Basically it places some extra limitations on what pages from the internet can do with stuff on your local network.
这个功能存在的原因是所谓的 phish farm漏洞利用,在那里发现一些流行的家用路由器/调制解调器的基于HTTP的配置屏幕安全性太差,恶意网页可能会重写您的路由器设置 - 例如将其配置为使用代理并管道所有通过恶意服务器的流量。为了解决这个问题,Opera知道公共网站上没有使用某些IP地址(例如127.0.0.1或192.168。*),并且它不允许来自公共站点的页面加载文件或发送请求到本地网站。
The reason this feature exists, is the emergence of the so called "phish farm" exploits, where it was discovered that the HTTP-based config screens of some popular home routers / modems were so poorly secured that malicious web pages could rewrite your router settings - for example to configure it to use a proxy and pipe all your traffic through a malicious server. To counter this, Opera knows that some IP addresses are not used on the public web (such as 127.0.0.1 or 192.168.*) and it doesn't allow pages from a "public" site to load files or send requests to a "local" site.
您可以按站点重新配置。最简单的事情可能是在公共站点上添加一个IFRAME,从本地服务器加载一个资源。 IFRAME将显示跨域请求警告页面,其中包含一些选择加入链接。单击链接以始终允许来自该服务器的本地请求,并且瞧 - 您的跨网络应用现在应该再次工作。
You can reconfigure this on a per-site basis. The easiest thing is probably adding an IFRAME on the "public" site loading one of the resources from the local server. The IFRAME will show a "cross-domain request" warning page with some opt-in links. Click the link for always allowing local requests from that server, and voila - your cross-network app should now work again.
(添加IFRAME就像查看源一样简单,添加< iframe src =http://local/whatever/included/file.js>< / iframe>
,保存和工具>高级 >从缓存重新加载)
(Adding an IFRAME is as easy as viewing source, adding <iframe src="http://local/whatever/included/file.js"></iframe>
, saving, and "Tools > Advanced > Reload from cache" )
这篇关于Opera不会加载一些JavaScript文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!