oracle-samples / xfc

A javascript library for Cross Frame Communication
Apache License 2.0
17 stars 24 forks source link

Add trigger for iframe unloading (beforeunload event) #17

Closed grneggandsam closed 6 years ago

grneggandsam commented 6 years ago

Please fill out the below template as best you can.

Description of Issue

As a consumer or content provider I would like the ability to use callback functions triggered by 'beforeunload' events within the frame. This is useful to allow consumers to detect when content within the frame is about to be redirected and perform actions based on the event. I would also like to be able to extract the url of a link clicked in the event a link caused the redirect.

A simple example would be for a consumer that is about to link within the frame and needs to scroll to the top of the page based on the redirect. With this feature, a callback can be registered which is triggered by an 'xfc.unload' event to scroll the page to the top.

Using version 1.3.0 of xfc

Expected Outcomes

kafkahw commented 6 years ago

Fixed in #18