function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
krishnanpradipkrishnanpradip 

How do we handle windows.top in lightning UI

I have built in some VF pages which are embeded in the page layout. These pages have some buttons on it which redirect to a new page.

For the page to open in the same page and not within the iframe i have used the javascript windows.top. Now this would not work on the new lightning UI as it would overwrite the lightning container.

I am pretty sure this is a use case for many existing applications. Is there a workaround or ideas to open the new page within the lightning container, but within the iframe holding the VF page in pageLayout
ylyl
Hi,

I think what you are talking about is that in classic mode you have:
                    window.top.location = 'some url';
Then in lightning mode you can try:
                    srcUp('some url');
You may need to check if srcUp function is available as well.