Skip to content

Commit d33f0d8

Browse files
exoegosjrd
authored andcommitted
Fix #354: Add PageTransitionEvent and corresponding event handler properties. (#359)
1 parent 03cdc02 commit d33f0d8

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

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

Lines changed: 41 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,24 @@ trait PopStateEvent extends Event {
78057828
cancelableArg: Boolean, stateArg: js.Any): Unit = js.native
78067829
}
78077830

7831+
/**
7832+
* The PageTransitionEvent is fired when a document is being loaded or unloaded.
7833+
*
7834+
* This interface also inherits properties from its parent, Event.
7835+
*
7836+
* MDN
7837+
*/
7838+
@js.native
7839+
trait PageTransitionEvent extends Event {
7840+
7841+
/**
7842+
* Indicates if the document is loading from a cache.
7843+
*
7844+
* MDN
7845+
*/
7846+
def persisted: Boolean = js.native
7847+
}
7848+
78087849
@js.native
78097850
trait DOMSettableTokenList extends DOMTokenList {
78107851
def value: String = js.native

0 commit comments

Comments
 (0)