简体   繁体   English

请求访问的帧的协议为“ https”,正在访问的帧的协议为“ http”。 协议必须匹配

[英]The frame requesting access has a protocol of “https”, the frame being accessed has a protocol of “http”. Protocols must match

I'm getting this error : 我收到此错误:

Uncaught SecurityError: Blocked a frame with origin " https://lss-servicedesk.techteam.com " from accessing a frame with origin " http://mydomain.com ". 未捕获到的SecurityError:阻止了源为“ https://lss-servicedesk.techteam.com ”的框架访问源为“ http://mydomain.com ”的框架。
The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". 请求访问的帧的协议为“ https”,正在访问的帧的协议为“ http”。 Protocols must match. 协议必须匹配。

<FORM ACTION=https://lss-servicedesk.techteam.com/CAisd/pdmweb.exe METHOD=POST onsubmit="return checkform(this);">

Is there any way to get around this problem ? 有什么办法可以解决这个问题? thanks in advance... 提前致谢...

You're getting 2 errors here. 您在这里遇到2个错误。 The first one is a cross-domain problem, and you won't be able to fix that. 第一个是跨域问题,您将无法解决。 It is impossible for your site to access the loaded iframe's site at all . 这是不可能为您的网站在所有访问加载iframe的网站。 Otherwise, the browser would be really insecure, allowing one site to very easily get the user's settings on another site by just loading an iframe. 否则,浏览器将是真正不安全的,从而允许一个站点通过仅加载iframe即可非常轻松地在另一站点上获取用户的设置。 So, you can't change anything within the iframe. 因此,您无法在iframe中进行任何更改。 The only thing you can do to the iframe's contents is iframeElement.src = '//otherurl.com'; 您只能对iframe的内容执行的操作是iframeElement.src = '//otherurl.com'; - changing the source url of the iframe. -更改iframe的源网址。

To fix the second problem, you can do the following: Instead of using http:// or https:// in the url you're defining in your scripts or forms, you can just use // . 要解决第二个问题,您可以执行以下操作:您可以使用http://代替在脚本或表单中定义的url中使用http://https:// // That will automatically 'fill in' the same protocol as the one you're using now. 这将自动“填写”与您现在使用的协议相同的协议。 So, if you're on http:// at the moment, it'll load the iframe in http:// too, and vice versa. 因此,如果您目前使用的是http:// ,它也会在http://加载iframe,反之亦然。

I had the same issue with two different domains going to my webserver. 我在将两个不同的域发送到Web服务器时遇到了相同的问题。 Both of them had DNS settings set to redirect domain.com (without www) to http://www.domain.com . 他们两个都设置了DNS设置以将domain.com(不带www)重定向到http://www.domain.com The one domain had issues similar to yours but it turned out that it was due to a DNS error where we had set FRAME to yes. 一个域的问题与您的相似,但事实证明这是由于DNS错误,我们将FRAME设置为yes。 After settings FRAME to no, it solved both issues (frame error and http/https error). FRAME设置为no后,它解决了两个问题(框架错误和http / https错误)。 It is a little thing but it caused the exact same error so just wanted to mention it as another possibility for anybody else who should stumble across this thread. 这是一件小事,但是它引起了完全相同的错误,因此只想提一下它,这是其他任何人在偶然发现此线程时的另一种可能性。

暂无
暂无

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

相关问题 请求访问的框架协议为“https”,被访问的框架协议为“chrome-extension”。 协议必须匹配 - The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "chrome-extension". Protocols must match Google资料库错误:请求访问的框架具有“https”协议,正在访问的框架具有“http”协议 - Google wallet error: The frame requesting access has a protocol of “https”, the frame being accessed has a protocol of “http” 请求访问的框架的协议为“ https”,正在访问的框架的协议为“ http” - The frame requesting access has a protocol of 'https', the frame being accessed has a protocol of 'http' for Linkedin 不安全的JavaScript尝试访问框架…协议必须匹配 - Unsafe JavaScript attempt to access frame…Protocols must match 阻止框架访问来源为“https://www.paypal.com”的框架。 协议、域和端口必须匹配。 这是什么意思? - Blocked a frame from accessing a frame with origin “https://www.paypal.com”. Protocols, domains, and ports must match. What does this mean? 协议HTTP和https不匹配 - Mismatch protocol http and https 未捕获的SecurityError:阻止具有原点“null”的帧访问具有原点“null”的帧。 协议,域和端口必须匹配 - Uncaught SecurityError: Blocked a frame with origin “null” from accessing a frame with origin “null”. Protocols, domains, and ports must match Javascript HTTPS-Frame对父HTTP-Frame的访问 - Javascript HTTPS-Frame Access to Parent HTTP-Frame 安全性错误:阻止了具有“ionic://localhost”来源的框架访问跨域框架。 协议、域和端口必须匹配 - SecurityError: Blocked a frame with origin “ionic://localhost” from accessing a cross-origin frame. Protocols, domains, and ports must match 检查 URL 是否有协议 http(s) 如果没有添加一个 javascript - Check if URL has protocol http(s) if not add one with javascript
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM