2

We're using iframes in Lightning and our links aren't working when locker service is turned on. If we turn locker service off they work fine.

I have the following function which is where the error seems to be happening:

navigateToUrl = url => window.top.postMessage({ type: 'navigate', url }, '*')

From my research it looks like window.top is the problem, but trying all of the other iframe tricks for navigation aren't working either.

The url param is valid. If I use window.location.href = url in it's place, the app navigates to the correct url, it just ejects from Lightning and loads in the traditional salesforce.

The ideal outcome here is for the links to load in Lightning.

Error that is blowing when the link is clicked:

enter image description here

1
  • Can you edit your question to include the relevant details of the error message as text, as opposed to a picture? Mar 15 '17 at 19:48
5

On the main window object window.top is currently blocked under LockerService, but is scheduled to be exposed in Summer '17.

This site is temporarily in read only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .