Instance Method

addContentStyleSheet

Adds a content style sheet from a string.

Declaration

DOMString addContentStyleSheet(in DOMString source, in array whitelist, in array blacklist);

Parameters

source

The source code of the style sheet.

whitelist

A list of patterns matching URLs of pages to which the script should be applied.

blacklist

A list of patterns matching URLs of pages to which the script should not be applied.

Return Value

If the style sheet was successfully added, a generated URL that can be used to remove it; otherwise, null.

Discussion

The style sheet behaves like a user-level style sheet. It is loaded after user-level style sheets and it can override them, as well as overriding page-level style sheets.

Pages that are already loaded are updated to use the style sheet after it is added.

See Also

Adding and Removing Scripts and Style Sheets

addContentScript

Adds a content script from a string.

addContentScriptFromURL

Adds a content script from a URL.

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.