Skip to content

Commit 56a3fd2

Browse files
author
exoego
committed
Add PageTransitionEvent and corresponding event handler properties.
1 parent 03cdc02 commit 56a3fd2

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

src/main/scala/org/scalajs/dom/raw/lib.scala

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2587,6 +2587,29 @@ class Window
25872587
*/
25882588
var onpopstate: js.Function1[PopStateEvent, _] = js.native
25892589

2590+
/**
2591+
* An event handler property for pagehide events, which are fired when the browser hides
2592+
* the current page in the process of presenting a different page from the session's history.
2593+
*
2594+
* For example, when the user clicks the browser's Back button, the current page receives a
2595+
* pagehide event before the previous page is shown.
2596+
*
2597+
* MDN
2598+
*/
2599+
var onpagehide: js.Function1[PageTransitionEvent, _] = js.native
2600+
2601+
/**
2602+
* An event handler property for pageshow events, which are fired when the browser makes the
2603+
* window's document visible due to navigation tasks. This includes the process of initially
2604+
* loading the page, navigating to the page from another page within the same window or tab,
2605+
* or returning to the page using the browser's forward or back buttons.
2606+
*
2607+
* When this event is sent during the page load process, it's sent after the load event.
2608+
*
2609+
* MDN
2610+
*/
2611+
var onpageshow: js.Function1[PageTransitionEvent, _] = js.native
2612+
25902613
/**
25912614
* Returns a new MediaQueryList object representing the parsed results of the
25922615
* specified media query string.
@@ -7805,6 +7828,22 @@ trait PopStateEvent extends Event {
78057828
cancelableArg: Boolean, stateArg: js.Any): Unit = js.native
78067829
}
78077830

7831+
/**
7832+
* This interface also inherits properties from its parent, Event.
7833+
*
7834+
* MDN
7835+
*/
7836+
@js.native
7837+
trait PageTransitionEvent extends Event {
7838+
7839+
/**
7840+
* Indicates if the document is loading from a cache.
7841+
*
7842+
* MDN
7843+
*/
7844+
def persisted: Boolean = js.native
7845+
}
7846+
78087847
@js.native
78097848
trait DOMSettableTokenList extends DOMTokenList {
78107849
def value: String = js.native

0 commit comments

Comments
 (0)