[英]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.