LeavePageHandler
Index
Constructors
Methods
Constructors
constructor
new LeavePageHandler(): LeavePageHandlerReturns LeavePageHandler
Methods
communicate Unload Flag
communicateUnloadFlag(value: boolean): voidTriggers communication of unload phase to the service worker if the value has changed.
Parameters
value: boolean
Returns void
execute Remaining Callbacks
executeRemainingCallbacks(unloadType: UnloadType): voidinit
init(): voidInitialises all event listeners related to the user leaving the current page.
Returns void
is Unloaded
isUnloaded(): booleanIndicates whether the current page was unloaded because the user left.
Returns boolean
on Leave Page
register Unload Communication
registerUnloadCommunication(): voidRegisters the different unload event listeners in the capture phase to early communicate the unload flag to the service worker via POST message.
Returns void
trigger Leave Page
triggerLeavePage(unloadType: UnloadType): voidChecks whether remaining data is available to send out before the user leaves.
Parameters
unloadType: UnloadType
Provides generic handling of data retrieval before users leave the page.