![]() ![]() #Iframe postmessage codeThe code above shows errors for any operations except: Iframe.onload = null // clear the handler, not to run it after the location change we can WRITE into location (and thus load something else into the iframe)! Can't read URL from the Location object also we can't READ the URL of the page in iframe Let doc = ntentDocument // ERRORĪlert(e) // Security Error (another origin) we can get the reference to the inner window After you receive the message, it is sure that VF has. When your VF is loaded, it sends out a message, lightning component will receive the message. In your VF, you do window.onload () function, where you postmessage to your lightning component with body 'loaded'. If that’s not so then the access is denied (writing to location is an exception, it’s still permitted).įor instance, let’s try reading and writing to from another origin: Add an event listener to your lightning component, which listens for message. ![]() When we access something inside the embedded window, the browser checks if the iframe has the same origin.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |