7

So I'm in the situation where I have a Lightning component that's embedded in LEX, and it provides links that open up a new window containing a Visualforce page. Each link opens the same page but passes a different ID parameter.

I've been using JavaScript's window.open method to achieve this, and it does work. The first click on a link opens the Visualforce page in a new window and shows the correct record.

The Problem

Clicking another link in the Lightning component correctly updates the URL in the popup window, and that displays what it should, but then LEX displays an error about cross-origin access:

Uncaught Action failed: cGuide:GuideWidget$controller$navigateToLink [Blocked a frame with origin "https://cwordguidepackaging-dev-ed.lightning.force.com" from accessing a cross-origin frame.] throws at https://cwordguidepackaging-dev-ed.lightning.force.com/auraFW/javascript/YKnqxnHX5EzqqKoVZYsoZQ/aura_prod.js:2:15

Is there a way to just bury this error?

Things I've Tried

  1. Using regular link tags instead of a controller/helper method - same result
  2. Storing the windowObjectReference returned by window.open in an attribute and then using it later - this gives the cross domain issue when trying to retrieve it from the component so can't use it

Crappy Workaround Currently In Play

Instead of storing a reference to the windowObjectReference I've established that I can store a reference to it's close() function instead, and then call that on the second click prior to opening another window. It does work, but it means a big flash of white in the popup window.

0

You must put your domain in remote site settings (setup)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.