简体   繁体   English

Opera不会加载一些JavaScript文件

[英]Opera won't load some JavaScript files

I have a web page that loads in an IFRAME, that runs correctly in IE and Firefox but not in Opera. 我有一个加载在IFRAME中的网页,它在IE和Firefox中正常运行,但在Opera中没有。 Which I hate, because I've been an Opera user for years. 我讨厌哪个,因为我多年来一直是Opera的用户。 And I wrote this thing. 我写了这个东西。 :-) :-)

The problem is that Opera is not loading some of the JavaScript files that comprise the page. 问题是Opera没有加载构成页面的一些JavaScript文件。 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. 我怀疑这与页面本身是通过HTTPS加载的事实有关,而且包含的文件是通过HTTP从不同的主机和端口加载的。 I believe Opera allows that, but Dragonfly's Net tab doesn't even show an attempt to load them. 我相信Opera允许这样做,但是Dragonfly的Net选项卡甚至没有显示加载它们的尝试。

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. 该页面是一个Rally “自定义应用程序”,我无法控制它在IFRAME中加载或通过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. 我也无法控制包含的文件是从不同的主机加载,或者主机只支持HTTP的事实。 So I'm sorta stuck with mixed content. 所以我有点混淆内容。

Among other stuff, the page's HEAD element contains (sanitized a bit): 除了其他东西之外,页面的HEAD元素包含(清理了一下):

<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>

ALL of the "/slm/..." stuff is getting loaded, and NONE of the "www.example..." stuff is. 所有 “/ SLM / ......”的东西是越来越加载,并没有 “www.example ......”的东西。

Anybody got an idea what I'm doing wrong? 有人知道我做错了什么吗?

Opera has a feature called cross-network protection. Opera具有称为跨网络保护的功能。 Basically it places some extra limitations on what pages from the internet can do with stuff on your local network. 基本上,它对来自互联网的页面可以对本地网络上的内容进行一些额外的限制。

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. 这个功能存在的原因是所谓的“网络钓鱼农场”漏洞的出现,在那里发现一些流行的家用路由器/调制解调器的基于HTTP的配置屏幕安全性太差,恶意网页可能会重写您的路由器设置 - 例如,将其配置为使用代理并通过恶意服务器管理所有流量。 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. 为了解决这个问题,Opera知道公共网站上没有使用某些IP地址(例如127.0.0.1或192.168。*),并且它不允许来自“公共”站点的页面加载文件或将请求发送到“当地的“网站。

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. 最简单的事情可能是在“公共”站点上添加一个IFRAME,从本地服务器加载一个资源。 The IFRAME will show a "cross-domain request" warning page with some opt-in links. IFRAME将显示“跨域请求”警告页面,其中包含一些选择加入链接。 Click the link for always allowing local requests from that server, and voila - your cross-network app should now work again. 单击链接以始终允许来自该服务器的本地请求,并且瞧 - 您的跨网络应用程序现在应该再次运行。

(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" ) (添加IFRAME就像查看源一样简单,添加<iframe src="http://local/whatever/included/file.js"></iframe> ,保存,以及“工具>高级>从缓存重新加载”)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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