admin管理员组

文章数量:1025754

Ever since I have installed an SSL certificate, I have an issue with running a js targeting some information ing from an iframe.

I keep getting:

Uncaught DOMException: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "https://www. *** .ro" from accessing a cross-origin frame.

While searching the internet I found out this is a security issue that won't allow you to load files from another domain or subdomain but the thing is, I am not loading from a subdomain or a different domain. I am loading directly from the same domain/iframe.php .

This happened right after adding an SSL certificate, before that, the exact same script worked without issues.

Ever since I have installed an SSL certificate, I have an issue with running a js targeting some information ing from an iframe.

I keep getting:

Uncaught DOMException: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "https://www. *** .ro" from accessing a cross-origin frame.

While searching the internet I found out this is a security issue that won't allow you to load files from another domain or subdomain but the thing is, I am not loading from a subdomain or a different domain. I am loading directly from the same domain/iframe.php .

This happened right after adding an SSL certificate, before that, the exact same script worked without issues.

Share Improve this question asked Feb 18, 2017 at 16:50 AlinAlin 1,2285 gold badges22 silver badges48 bronze badges 1
  • Show us the code? – Raymond Nijland Commented Feb 18, 2017 at 16:56
Add a ment  | 

2 Answers 2

Reset to default 1

Try using object and embed to simulate a iframe maybe this works

<object data="https://...." width="600" height="400">
    <embed src="https://...." width="600" height="400"> </embed>
</object>

The issue was one of absolute vs relative url for the iframe.

I initially used the website's full url (https://www.***.ro/iframe.php) which made it look like trying to load a page from another domain even if it wasn't. Once I changed it to simply ../iframe.php everything is back to normal.

Ever since I have installed an SSL certificate, I have an issue with running a js targeting some information ing from an iframe.

I keep getting:

Uncaught DOMException: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "https://www. *** .ro" from accessing a cross-origin frame.

While searching the internet I found out this is a security issue that won't allow you to load files from another domain or subdomain but the thing is, I am not loading from a subdomain or a different domain. I am loading directly from the same domain/iframe.php .

This happened right after adding an SSL certificate, before that, the exact same script worked without issues.

Ever since I have installed an SSL certificate, I have an issue with running a js targeting some information ing from an iframe.

I keep getting:

Uncaught DOMException: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "https://www. *** .ro" from accessing a cross-origin frame.

While searching the internet I found out this is a security issue that won't allow you to load files from another domain or subdomain but the thing is, I am not loading from a subdomain or a different domain. I am loading directly from the same domain/iframe.php .

This happened right after adding an SSL certificate, before that, the exact same script worked without issues.

Share Improve this question asked Feb 18, 2017 at 16:50 AlinAlin 1,2285 gold badges22 silver badges48 bronze badges 1
  • Show us the code? – Raymond Nijland Commented Feb 18, 2017 at 16:56
Add a ment  | 

2 Answers 2

Reset to default 1

Try using object and embed to simulate a iframe maybe this works

<object data="https://...." width="600" height="400">
    <embed src="https://...." width="600" height="400"> </embed>
</object>

The issue was one of absolute vs relative url for the iframe.

I initially used the website's full url (https://www.***.ro/iframe.php) which made it look like trying to load a page from another domain even if it wasn't. Once I changed it to simply ../iframe.php everything is back to normal.

本文标签: javascriptUncaught DOMException Failed to read the 39contentDocument39Stack Overflow