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

前端 未结 2 479
星月不相逢
星月不相逢 2020-12-10 14:02

I\'m getting this error :

Uncaught SecurityError: Blocked a frame with origin \"https://lss-servicedesk.techteam.com\" from accessing a frame with origin \"http://m

相关标签:
2条回答
  • 2020-12-10 14:46

    I had the same issue with two different domains going to my webserver. Both of them had DNS settings set to redirect domain.com (without www) to 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. After settings FRAME to no, it solved both issues (frame error and http/https error). 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.

    0 讨论(0)
  • 2020-12-10 14:48

    You're getting 2 errors here. 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. 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. So, you can't change anything within the iframe. The only thing you can do to the iframe's contents is iframeElement.src = '//otherurl.com'; - changing the source url of the 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 //. 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.

    0 讨论(0)
提交回复
热议问题