Unstable
Enables an SDK module loaded into a child process to communicate with modules in the main process.
Usage
The sdk/remote/parent
module enables SDK code to load modules into child processes. The sdk/remote/child
module is for these "child process modules". It provides two main things:
- access to web content loaded into this child process
port
mechanisms to communicate with the main process
See the documentation for sdk/remote/parent
for more details.
Frame
A Frame
represents a content frame in this process and provides a way to communicate frame specific events to the main process.
Properties
port
An event emitter that can be used to send and receive frame specific events to and from code in the main process.
content
The top level DOM window currently displaying in this frame.
isTab
A boolean property indicating if this frame displays in one of the application's main browser tabs.
Methods
addEventListener(event, listener, isCapturing)
Adds an event listener for DOM events dispatched by this content frame. This can include load
and unload
events from any content that is loaded in the frame. Listeners are automatically removed when this frame is destroyed.
removeEventListener(event, listener, isCapturing)
Removes an event listener that was previously registered.
Events
detach
Event emitted when this frame disconnects from the application.
Globals
Properties
process
A link to the main process
port
An event emitter that sends and receives events from the main process.
isRemote
A boolean property indicating whether this process is remote from the main process or not.
frames
A list of the content frames in this process. Each element in this list is a Frame. Listen to attach
and detach
events to hear as frames are created and destroyed.
port
An event emitter that sends and receives events from all frames.
forEvent(callback)
Calls the callback for every existing frame and any new frames created in the future. This is a shortcut for enumerating existing frames and then listening for attach events.
getFrameForWindow(window)
Finds the frame for a top level DOM window.
addEventListener(event, listener, isCapturing)
Adds an event listener for DOM events dispatched to any existing and future frames.
removeEventListene(event, listener, isCapturing)
Removes an event listener that was previously registered.