Class Policy
Defined in: ContentPolicy.jsm.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Policy()
Public policy checking functions and auxiliary objects
|
| Field Attributes | Field Name and Description |
|---|---|
| <static> |
Policy.localizedDescr
Map of localized content type names by their identifiers.
|
| <static> |
Policy.nonVisual
Lists the non-visual content types.
|
| <static> |
Policy.type
Map of content type identifiers by their name.
|
| <static> |
Policy.typeDescr
Map of content type names by their identifiers (reverse of type map).
|
| <static> |
Policy.whitelistSchemes
Map containing all schemes that should be ignored by content policy.
|
| Method Attributes | Method Name and Description |
|---|---|
| <static> |
Policy.isBlockableScheme(location)
Checks whether the location's scheme is blockable.
|
| <static> |
Policy.isWhitelisted(url, parentUrl)
Checks whether a page is whitelisted.
|
| <static> |
Policy.isWindowWhitelisted(wnd)
Checks whether the page loaded in a window is whitelisted.
|
| <static> |
Policy.processNode(wnd, node, contentType, location, collapse)
Checks whether a node should be blocked, hides it if necessary
|
| <static> |
Policy.refilterNodes(nodes, entry)
Asynchronously re-checks filters for given nodes.
|
| <static> |
Policy.shutdown()
|
| <static> |
Policy.startup()
Called on module startup.
|
Field Detail
<static>
{Object}
Policy.localizedDescr
Map of localized content type names by their identifiers.
<static>
{Object}
Policy.nonVisual
Lists the non-visual content types.
<static>
{Object}
Policy.type
Map of content type identifiers by their name.
<static>
{Object}
Policy.typeDescr
Map of content type names by their identifiers (reverse of type map).
<static>
{Object}
Policy.whitelistSchemes
Map containing all schemes that should be ignored by content policy.
Method Detail
<static>
{Boolean}
Policy.isBlockableScheme(location)
Checks whether the location's scheme is blockable.
- Parameters:
- location
- {nsIURI}
- Returns:
- {Boolean}
<static>
{Filter}
Policy.isWhitelisted(url, parentUrl)
Checks whether a page is whitelisted.
- Parameters:
- {String} url
- {String} parentUrl Optional
- location of the parent page
- Returns:
- {Filter} filter that matched the URL or null if not whitelisted
<static>
{Filter}
Policy.isWindowWhitelisted(wnd)
Checks whether the page loaded in a window is whitelisted.
- Parameters:
- wnd
- {nsIDOMWindow}
- Returns:
- {Filter} matching exception rule or null if not whitelisted
<static>
{Boolean}
Policy.processNode(wnd, node, contentType, location, collapse)
Checks whether a node should be blocked, hides it if necessary
- Parameters:
- wnd
- {nsIDOMWindow}
- node
- {nsIDOMElement}
- contentType
- {String}
- location
- {nsIURI}
- collapse
- {Boolean} true to force hiding of the node
- Returns:
- {Boolean} false if the node should be blocked
<static>
Policy.refilterNodes(nodes, entry)
Asynchronously re-checks filters for given nodes.
- Parameters:
- {Node[]} nodes
- {RequestEntry} entry
<static>
Policy.shutdown()
<static>
Policy.startup()
Called on module startup.