Members
messageListeners :Object.<string, Array.<function()>>
Mapping of event and its handlers.
Type:
-
Object.<string, Array.<function()>>
messageListeners :Object.<string, Array.<function()>>
Mapping of event and its handlers.
Type:
-
Object.<string, Array.<function()>>
options :Options
Options instance of this module to get/set extension general options and module special options.
Type:
-
Options
options :Options
Options instance of this module to get/set extension general options and module special options.
Type:
-
Options
port :chrome.runtime.Port
The webExtension port to communicate with the background script.
Type:
-
chrome.runtime.Port
port :chrome.runtime.Port
The webExtension port to communicate with the background script.
Type:
-
chrome.runtime.Port
Methods
addMessageListener(typenon-null, fnnon-null)
Register a callback function to execute when a message with provided type has been recived from the background script.
Parameters:
Name | Type | Description |
---|---|---|
type |
string
|
The type of message to handle. |
fn |
function
|
The callback function to execute when a message with provided type is recived. |
addMessageListener(typenon-null, fnnon-null)
Register a callback function to execute when a message with provided type has been recived from the background script.
Parameters:
Name | Type | Description |
---|---|---|
type |
string
|
The type of message to handle. |
fn |
function
|
The callback function to execute when a message with provided type is recived. |
log(…args)
Log a message to the console if debug mode is enabled.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
args |
string
|
<repeatable> |
Strings to print on the debug message. |
log(…args)
Log a message to the console if debug mode is enabled.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
args |
string
|
<repeatable> |
Strings to print on the debug message. |
(abstract) onComplete()
Module code to execute after full page is loaded (DOM ready and other resources are loaded)
(abstract) onComplete()
Module code to execute after full page is loaded (DOM ready and other resources are loaded)
(abstract) onInteractive()
Module code to execute when DOM tree is ready but other resources are still loading
(abstract) onInteractive()
Module code to execute when DOM tree is ready but other resources are still loading
(abstract) onLoading()
Module code to execute when page loading starts (before DOM tree is ready)
(abstract) onLoading()
Module code to execute when page loading starts (before DOM tree is ready)
start()
The module routine execution function. It ensures module options has been recived from the background script and execute module functions (onLoading, onInteractive, onComplete). Ensure to call this function at the end of module file the following way:
Example
new ChildModuleX().start();
start()
The module routine execution function. It ensures module options has been recived from the background script and execute module functions (onLoading, onInteractive, onComplete). Ensure to call this function at the end of module file the following way:
Example
new ChildModuleX().start();