IDL file: mozilla-central/source/dom/base/nsIMessageManager.idl
Inherits from: nsISupports
This interface is used by parent process message managers to load scripts into a child process. The scripts run only once per process. The global object for process scripts is a ContentProcessMessageManager.
|
void removeDelayedProcessScript(in AString aURL); |
jsval getDelayedProcessScripts(); |
Load a script in the child process. Process scripts are loaded as soon as loadProcessScript()
is called.
If this function is called on a ChromeMessageBroadcaster
, :
aAllowDelayedLoad
is true
, then the script will also be loaded into any new child processes created after the loadProcessScript()
call. Otherwise it will only be loaded into child processes that exist at the time of the call.If this function is called on a ChromeMessageSender
:
ChromeMessageSender
's child processaAllowDelayedLoad
should always be true
. It's possible that the child process for this ChromeMessageSender
is not yet available at the time of the loadProcessScript()
call, and if you pass false
in this situation, your process script won't be loaded.For example:
let ppmm = Services.ppmm.getChildAt(1); ppmm.loadProcessScript('data:,dump("foo\n");', true);
Name | Type | Description |
---|---|---|
aURL |
String | URL for the script to load. aURL must be the absolute URL. data: URLs are also supported. For example data:,dump("foo\n"); |
aAllowDelayedLoad |
Boolean |
If this flag is If this flag is true, the process script will be loaded into any new child processes created after the If you are calling |
Removes aURL
from the list of scripts which support delayed load.
This cancels the effect of the aAllowDelayedLoad
flag, meaning that the loader will no longer load the script into new child processes. If you used aAllowDelayedLoad
, you should call this as part of your cleanup (for example, when your add-on is disabled or uninstalled).
Name | Type | Description |
---|---|---|
aURL |
String | URL for the script to remove. |
Returns all delayed scripts that will be loaded once a child process becomes available. The return value is a list of pairs [<URL>, false]
.
List of the delayed scripts. Each script is returned as a pair: [<URL>, false]
.