Skip to main content Link Search Menu Expand Document (external link)

The Preloader Registry Interface

The preloader registry interface allows you register preloaders. A preloader is code that runs when a tab navigates to a specific URLs.

There is only one preloader registry and it can always be found at jancy.preloaders.

Methods

preloaders.add(preloader)

  • preloader (object)
    • urlPatterns ([string])
    • pluginPath (string)
    • entry (string)

Adds a preloader object to the registry. The function at entry in the plugin at pluginPath will be called when any of the URL patterns in the array of urlPatterns is matched against a tab’s URL.

Returns a unique identifier for the preloader.

preloaders.remove(id)

  • id (string)

Removes a preloader from the list of preloaders by id.

Example

For an example of a working preloader please see our example GitHub repo here.