Show:

Members

global

...

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.

Since:
  • 1.12.2
Source:

global

...

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

Since:
  • 1.12.2
Source:

global

...

window

...

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

Since:
  • 1.5.8
Source:

window

...

Events

error_caught(errorObject)

...

Fired via mw.track when an error is logged with mw.errorLogger#logError.

Parameters:
Name Type Description
errorObject Error

The error object

Source:

global_error(errorMessage, url, line, columnopt, errorObjectopt)

...

Fired via mw.track when an error is not handled by local code and is caught by the window.onerror handler.

Parameters:
Name Type Attributes Description
errorMessage string

Error message.

url string

URL where error was raised.

line number

Line number where error was raised.

column number <optional>

Line number where error was raised. Not all browsers support this.

errorObject Error | Mixed <optional>

The error object. Typically an instance of Error, but anything (even a primitive value) passed to a throw clause will end up here.

Source:

resourceloader_exception(e, moduleopt, source)

...

Fired via mw.track on various resource loading errors.

Parameters:
Name Type Attributes Description
e Error | Mixed

The error that was thrown. Almost always an Error object, but in theory module code could manually throw something else, and that might also end up here.

module string <optional>

Name of the module which caused the error. Omitted if the error is not module-related or the module cannot be easily identified due to batched handling.

source string

Source of the error. Possible values:

  • load-callback: exception thrown by user callback
  • module-execute: exception thrown by module code
  • resolve: failed to sort dependencies for a module in mw.loader.load
  • store-eval: could not evaluate module code cached in localStorage
  • store-localstorage-json: JSON conversion error in mw.loader.store
  • store-localstorage-update: localStorage conversion error in mw.loader.store.
Source: