0

I'm not sure how I can fix the error below. Can somebody help me out?

Uncaught SecurityError: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "http://mysite.net" from accessing a frame with origin "https://www.youtube.com". The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "https". Protocols must match.

J82
  • 8,267
  • 23
  • 58
  • 87

2 Answers2

1

You are trying to access an https url from within a http website. HTTPS and HTTP are different protocol and is causing a mismatch.

I think the following link might help: https://productforums.google.com/forum/#!topic/chrome/ODpydGiCgiE

if you want to access frames in a iframe you can change top with 
parent.frames only for accessing frames in the iframe who execute javascript.
try to change top with parent.frames

return top.frames;

return parent.frames;

in google chrome it work for me i can access all my frames in my iframe.

Or if you are just trying to access your own domain with different protocol, you can also try setting the Access-Control-Allow-Origin header.

How does Access-Control-Allow-Origin header work?

Community
  • 1
  • 1
Edward
  • 1,914
  • 13
  • 26
0

Try using // instead of specifying the protocol with http:// or https:// in the iFrame URL address source address. It should use the protocol of the site.

Arne H. Bitubekk
  • 2,963
  • 1
  • 27
  • 34