我正在尝试将一个简单的iframe加载到我的一个网页中,但它没有显示.我在Chrome中收到此错误:
Refused to display 'https://cw.na1.hgncloud.com/crossmatch/index.do' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self' https://cw.na1.hgncloud.com".
Invalid 'X-Frame-Options' header encountered when loading 'https://cw.na1.hgncloud.com/crossmatch/index.do': 'ALLOW-FROM https://cw.na1.hgncloud.com' is not a recognized directive. The header will be ignored.
Run Code Online (Sandbox Code Playgroud)
这是我的iframe的代码:
<p><iframe src="https://cw.na1.hgncloud.com/crossmatch/" width="680" height="500" frameborder="0"></iframe></p>
Run Code Online (Sandbox Code Playgroud)
我不太确定这意味着什么.我以前加载了很多iframe,但从未收到过这样的错误.
有任何想法吗?
谢谢
对于初学者......我没有任何恶意的意图让用户接受弹出窗口或类似的东西.我只是想阻止用户调整他们已经导航过的网页的浏览器窗口(意味着我无权访问/不想使用window.open();).我已经研究了很长一段时间,但似乎找不到直截了当的答案.
我觉得我正在走上正轨:
$(window).resize(function() {
var wWidth = window.width,
wHeight = window.height;
window.resizeBy(wWidth, wHeight);
});
Run Code Online (Sandbox Code Playgroud)
......无济于事 我不得不想象这是可能的.是吗?如果是这样,我一定会感谢你的帮助.
谢谢
我有一些JavaScript用于使窗口不可调整大小,类似于:
window.open(URL, id, "resizable=no");
Run Code Online (Sandbox Code Playgroud)
这适用于大多数浏览器,但在Chrome中似乎不支持.我曾考虑使用JavaScript来观察重新调整大小并将其设置回来,但这并不理想.有没有人有任何其他建议?提前致谢.