PageSwapEvent: PageSwapEvent() constructor
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The PageSwapEvent()
constructor creates a new
PageSwapEvent
object instance.
Syntax
new PageSwapEvent(type, init)
Parameters
type
-
A string representing the type of event. In the case of
PageSwapEvent
this is alwayspageswap
. init
-
An object containing the following properties:
activation
-
A
NavigationActivation
object representing the navigation type and current and destination document history entries. Defaults tonull
if the associated navigation is a cross-origin navigation. viewTransition
-
A
ViewTransition
object representing the active view transition for the related navigation. Defaults tonull
if there is no active view transition.
Examples
A developer would not use this constructor manually. A new PageSwapEvent
object is constructed when a handler is invoked as a result of the pageswap
event firing.
Specifications
Specification |
---|
HTML Standard # the-pageswapevent-interface |
Browser compatibility
BCD tables only load in the browser