Notifications
Clear all

document.domain deprecated

7 Posts
2 Users
0 Reactions
578 Views
Posts: 4
Topic starter
(@pthagaard)
Active Member
Joined: 1 year ago

Hi guys,

We are using iFrame Pro on a subdomain to have data-share between our APP-server and WEB-server.

However; Chrome has deprecated the document_domain feature and is now showing error like:
"Uncaught DOMException: Blocked a frame with origin "https://api.XXXXX.dk" from accessing a cross-origin frame."

The issue occurs around here (among other places):
window.top.document.querySelector("iframe") && window.parent.scroll(0, 0);

Google writes, in their deprecation-notice, that the fix, if document.domain is still needed is to "As a last resort, send the Origin-Agent-Cluster: ?0 header"

Will the above be fixed in iFrame Pro (or has it already and im just missing a setting i cant find?)

// Patrick

6 Replies
TinyWebGallery
Posts: 925
Admin
(@admin)
Prominent Member
Joined: 16 years ago

Please see:

https://www.tinywebgallery.com/blog/sub-domain-workaround-with-chrome

Please use the real external workaround of the pro version.

Best regards,

Michael

Reply
2 Replies
(@pthagaard)
Joined: 1 year ago

Active Member
Posts: 4

@admin Hi,

We've set it up (always have been) but we are not getting any solutions after following the external JS guide + debugging.

Debugging log:

Advanced iframe: aiResizeLater_advanced_iframe
ai_external.js:1092 Advanced iframe: calling aiModifyIframe
ai_external.js:1092 Advanced iframe: aiInitElementResize_advanced_iframe
ai_external.js:1092 Advanced iframe: aiGetIframeWidth
ai_external.js:1092 Advanced iframe: postMessage sent: {"aitype":"height","height":10563,"width":1200,"id":"advanced_iframe","anchor":-1,"data":{}} - targetOrigin: *
?id=6CB9231D-D3F0-4EEC-99F9-AFDCC8B3DEF1&aiEnableDebugConsole=true:3127 Advanced iframe: postMessage received: {"aitype":"height","height":10563,"width":1200,"id":"advanced_iframe","anchor":-1,"data":{}} - origin:  https://api.sensemydiet.dk 
ai_external.js:1092 Advanced iframe: aiExecuteWorkaround_advanced_iframe
ai_external.js:1092 Advanced iframe: aiResizeLater_advanced_iframe
ai_external.js:1092 Advanced iframe: calling aiModifyIframe
ai_external.js:1092 Advanced iframe: aiInitElementResize_advanced_iframe
ai_external.js:1092 Advanced iframe: aiGetIframeWidth
ai_external.js:1092 Advanced iframe: postMessage sent: {"aitype":"height","height":10674,"width":1200,"id":"advanced_iframe","anchor":-1,"data":{}} - targetOrigin: *
?id=6CB9231D-D3F0-4EEC-99F9-AFDCC8B3DEF1&aiEnableDebugConsole=true:3127 Advanced iframe: postMessage received: {"aitype":"height","height":10674,"width":1200,"id":"advanced_iframe","anchor":-1,"data":{}} - origin:  https://api.sensemydiet.dk 
recipe_modal.min.js:1 Uncaught DOMException: Blocked a frame with origin "https://api.sensemydiet.dk" from accessing a cross-origin frame.
    at HTMLDivElement.<anonymous> ( https://api.sensemydiet.dk/js_custom/recipe_modal.min.js:1:271) 
    at HTMLDivElement.dispatch ( https://code.jquery.com/jquery-3.5.1.min.js:2:43090) 
    at v.handle ( https://code.jquery.com/jquery-3.5.1.min.js:2:41074) 
    at Object.trigger ( https://code.jquery.com/jquery-3.5.1.min.js:2:71513) 
    at HTMLDivElement.<anonymous> ( https://code.jquery.com/jquery-3.5.1.min.js:2:72108) 
    at Function.each ( https://code.jquery.com/jquery-3.5.1.min.js:2:2976) 
    at S.fn.init.each ( https://code.jquery.com/jquery-3.5.1.min.js:2:1454) 
    at S.fn.init.trigger ( https://code.jquery.com/jquery-3.5.1.min.js:2:72084) 
    at a ( https://cdn.jsdelivr.net/npm/bootstrap @4.6.0/dist/js/bootstrap.bundle.min.js:6:52936)
    at e._showElement ( https://cdn.jsdelivr.net/npm/bootstrap @4.6.0/dist/js/bootstrap.bundle.min.js:6:53086)
Reply
(@pthagaard)
Joined: 1 year ago

Active Member
Posts: 4

@admin

@admin Hi,

Update:

I've added a non-user-required page to debug on here: https://www.sensemydiet.dk/aitestlink/?id=6CB9231D-D3F0-4EEC-99F9-AFDCC8B3DEF1

The first iframe works fine; but when clicking the images under "Dag 1" or "Dag 2" (and so on), it throws the cross-origin block exception.

Click the image attached on this ticket; to trigger cross-origin error

 
Reply
TinyWebGallery
Posts: 925
Admin
(@admin)
Prominent Member
Joined: 16 years ago

Hi,

recipe_modal.min.js:1 Uncaught DOMException: 

Is not part of my plugin. You should check what is causing this error! 
Before you see that the postMessage from advanced iframe is properly received. 

Also I see an error from foodplan.min.js which is also not caused by advanced iframe.

So it seems the scripts on your page are not running properly in an iframe.

I checked on https://www.tinywebgallery.com/blog/advanced-iframe/free-iframe-checker - There a normal iframe without anything is used. I already see the error there. 

So you need to fix them first.

Best regards, Michael

 

Reply
1 Reply
(@pthagaard)
Joined: 1 year ago

Active Member
Posts: 4

@admin You are correct; im sorry you had to spend time on that - i'll forward it to the app-developers.

Thanks for being awesome!

Reply
TinyWebGallery
Posts: 925
Admin
(@admin)
Prominent Member
Joined: 16 years ago

If the other issues are solved and you still have a issue with resize please let me know. The debug mode I think is very helpful as you can simply see if there is a height update sent or not.

Best regards,

Michael

Reply