Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

stylesheet/utils

Experimental

Helper functions for working with stylesheets.

Globals

Functions

loadSheet(window, uri, type)

Synchronously loads a style sheet from uri and adds it to the list of additional style sheets of the document. The sheets added takes effect immediately, and only on the document of the window given.

Parameters

window : nsIDOMWindow

uri : string,
nsIURI}

type : string
The type of the sheet. It accepts the following values: "agent", "user" and "author". If not provided, the default value is "author".

removeSheet(window, uri, type)

Remove the document style sheet at sheetURI from the list of additional style sheets of the document. The removal takes effect immediately.

Parameters

window : nsIDOMWindow

uri : string,
nsIURI}

type : string
The type of the sheet. It accepts the following values: "agent", "user" and "author". If not provided, the default value is "author".

isTypeValid(type)

Verifies that the type given is a valid stylesheet's type. The values considered valid are: "agent", "user" and "author".

Parameters

type : string
The type of the sheet.

Returns

boolean : true if the type given is valid, otherwise false.

Document Tags and Contributors

 Contributors to this page: wbamberg
 Last updated by: wbamberg,