This article needs a technical review. How you can help.
This interface is used to load frame scripts.
Load a script in the remote frame. Frame scripts are loaded as soon as
loadFrameScript() is called.
loadFrameScript()will load the frame script independently into each applicable frame: every open frame in the given window for the window message manager, or every frame in every window for the global message manager
true, then the script will also be loaded into any applicable new frames opened after the
loadFrameScript()call. Otherwise it will only be loaded into frames that exist at the time of the call.
If this function is called on a
- it will load the frame script only into this
aAllowDelayedLoadshould always be
true. It's possible that the frame for this
ChromeMessageSenderis not yet available at the time of the
loadFrameScript()call, and if you pass
falsein this situation, your process script won't be loaded.
let windowMM = window.messageManager;
This will load a separate instance of the frame script into every tab open in the window associated with this window message manager. As the user opens new tabs in this window, copies of the script will be loaded into these new tabs, as well.
Frame scripts are essentially per-tab, so they don't get reloaded when the user navigates. If you want a frame script to do something whenever a new document is loaded, you can listen for the
||String||URL for the script to load. aURL must be the absolute URL.
Optional, defaults to
By default, frame scripts each have their own scope, so they can declare global variables without causing conflicts with any other frame scripts. If present and set to
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 frames. If you used
aAllowDelayedLoad, you should call this as part of your cleanup (for example, when your add-on is disabled or uninstalled).
||String||URL for the script to remove.|
Returns all delayed scripts that will be loaded once a (remote) frame becomes available. The return value is a list of pairs
List of the delayed scripts. Each script is returned as a pair: