Instance Method

addContentScriptFromURL

Adds a content script from a URL.

Declaration

DOMString addContentScriptFromURL(in DOMString url, in array whitelist, in array blacklist, in boolean runAtEnd);

Parameters

url

The URL of the script.

whitelist

A list of patterns matching URLs of pages on which the script should be run.

blacklist

A list of patterns matching URLs of pages on which the script should not be run.

runAtEnd

If true, the script waits until the page is fully loaded before running.

Return Value

If the script was successfully added, the supplied URL; otherwise, null.

Discussion

If runAtEnd is true, the script is run as soon as the page has completely finished loading. Otherwise, it is run as soon as the DOM is ready, before loading subresources such as images and the contents of frames, which allows you to block resources from being loaded.

See Also

Adding and Removing Scripts and Style Sheets

addContentScript

Adds a content script from a string.

addContentStyleSheet

Adds a content style sheet from a string.

addContentStyleSheetFromURL

Adds a content style sheet from a URL.

removeContentScript

Removes the specified content script.

removeContentScripts

Removes all content scripts added by this extension.

removeContentStyleSheet

Removes the specified content style sheet.

removeContentStyleSheets

Removes all content style sheets added by this extension.