简体   繁体   English

可能拦截来自iframe(相同域)内部的XMLHttpRequest?

[英]Possible to intercept XMLHttpRequests coming from inside iframe (same domain)?

I have a page that's loaded using https, and it embeds an iframe on the same domain, also loaded via https. 我有一个使用https加载的页面,它在同一域中嵌入了iframe,也通过https加载了。

Inside the iframe, there are some XHR requests to an insecure http URL (the URL is actually to an IP address on the local network) that are being blocked. 在iframe中,对不安全的http URL(该URL实际上是本地网络上的IP地址)有一些XHR请求被阻止。

Is there any way I can allow the requests to the local IP address? 有什么办法可以允许请求到本地IP地址? I only have access to edit the code in the parent frame. 我只能在父框架中编辑代码。 I can use php or javascript in the parent frame. 我可以在父框架中使用php或javascript。

Unless you recompile your browser, CORS explicitly prohibits this and no browser would allow it, unless the local IP machine returns valid CORS headers. 除非您重新编译浏览器,否则CORS明确禁止这样做,并且除非本地IP机器返回有效的CORS标头,否则浏览器将不允许这样做。

See here for CORS headers info: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests 请参阅此处以获取CORS标头信息: https : //developer.mozilla.org/zh-CN/docs/Web/HTTP/CORS#Simple_requests

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

相关问题 从同一个域重置iframe中的表单 - reset forms inside an iframe from same domain 在来自不同域的iFrame上运行bookmarklet - Running a bookmarklet on an iFrame that is coming from a different domain iframe如何从iframe内部调整ifize(iframe和页面 - 同一个域) - How catch iframe resize event from inside the iframe (iframe and the page - same domain) 如果iframe的内容来自同一域,是否可以使div跟随另一个元素iside进入iframe - Is it possible to make a div follow another element iside an iframe if the content of the iframe is from the same domain 如何从Greasemonkey脚本拦截XMLHttpRequests? - How can I intercept XMLHttpRequests from a Greasemonkey script? 是否可以为在 iframe(同一域)内导航的用户捕获 JS 事件? - Is it possible to catch a JS event for a user who navigates inside of iframe (same domain)? 拦截iframe消息嵌套iframe,跨域 - Intercept iframe message nested iframe, cross domain 禁用相同来源策略/在WebKit WebViews中进行跨域XMLHttpRequests? - Disable the Same Origin Policy / making cross domain XMLHttpRequests in WebKit WebViews? 来自不同安全域的iFrame上的书签和导航 - Bookmark & navigation on an iFrame that is coming from a different secured domain 可以阻止我们的网站在另一个域的框架集或IFrame中运行? - Possible to prevent our website from running inside another domain's frameset or IFrame?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM