web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Error with window.top.opener in Unified Client Interface

(0) ShareShare
ReportReport
Posted on by 7,316
Hi,
I have a client side script with window.top.opener line in it. This is where error is being thrown when debugged.
This script was working fine but started throwing this below error today.
Blocked a frame with origin "">http://www.<domain>.com" from accessing a cross-origin frame.

I know using window.top is not supported but it was working fine, so didn't look into it earlier.
Can somebody please let me know what this error means and how to fix it?
Thanks for any help.

I have the same question (0)
  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    Hi meenoo,

    window.top is not supported. When used, The following script error will be displayed to users or included in your error logs: Error: Blocked a frame with origin "https://<yourinstance>.dynamics.com" from accessing a cross-origin frame. The error means that you are trying to access a window owned by an application context external to Dynamics 365. Due to the differing origins, the browser presents the user with a cross-origin security error.

    The following are the recommended approaches:

    • Avoid usage of the window.top object altogether.

    • If using window.top is the only available option, first test to determine whether window.top is accessible by using the script below. If it's not available, provide alternate logic or a fallback user experience.

    function isTopAccessible() {
        try {
                window.top.location;
                return true;
            }
            catch (err) {
                return false;
            }
    }
    
    var canAccess = isTopAccessible();
    alert(canAccess);

  • Suggested answer
    Pankaj Gogoi Profile Picture
    3,177 on at

    Hello,

    As suggested, you should avoid using the window.top. if you can, let us know what your requirement and we can suggest alternative design approach.

    Here is a link for your reference.

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/use-iframe-and-web-resource-controls-on-a-form#enabling-iframe-communication-across-domains

    Best Regards

    PG

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Pallavi Phade Profile Picture

Pallavi Phade 102 Super User 2026 Season 1

#2
ManoVerse Profile Picture

ManoVerse 55 Super User 2026 Season 1

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 55 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans