Expand all

window

The global window object.

These methods exist for backwards compatibility and should not be considered stable.

Methods

addOnloadHook(fn)static #

Schedule a function to run once the page is ready (DOM loaded).

Parameters:

Name Type Description
fn function
Since:
  • 1.5.8
Source:
Schedule a function to run once the page is ready (DOM loaded).

importScript(title) → {HTMLElement|null}static #

Import a local JS content page, for use by user scripts and site-wide scripts.

Note that if the same title is imported multiple times, it will only be loaded and executed once.

Parameters:

Name Type Description
title string
Since:
  • 1.12.2
Source:

Returns:

Script tag, or null if it was already imported before

Type
HTMLElement | null
Import a local JS content page, for use by user scripts and site-wide scripts.

importScriptURI(url) → {HTMLElement|null}static #

Import a script using an absolute URI.

Parameters:

Name Type Description
url string
Since:
  • 1.12.2
Source:

Returns:

Script tag, or null if it was already imported before

Type
HTMLElement | null
Import a script using an absolute URI.

importStylesheet(title) → {HTMLElement}static #

Import a local CSS content page, for use by user scripts and site-wide scripts.

Parameters:

Name Type Description
title string
Since:
  • 1.12.2
Source:

Returns:

Link tag

Type
HTMLElement
Import a local CSS content page, for use by user scripts and site-wide scripts.

importStylesheetURI(url, media) → {HTMLElement}static #

Import a stylesheet using an absolute URI.

Parameters:

Name Type Description
url string
media string
Since:
  • 1.12.2
Source:

Returns:

Link tag

Type
HTMLElement
Import a stylesheet using an absolute URI.