Methods
connect
Port chrome.extension.connect(, object connectInfo)
Undocumented.
Attempts to connect to other listeners within the extension (listeners may be toolstrips or the extension's background page). This is primarily useful for content scripts connecting to their extension processes. Extensions may connect to content scripts embedded in tabs via chrome.tabs.connectToTab.
Parameters
- connectInfo
(
optional Type array of object )
- Undocumented.
- Description of this parameter from the json schema.
-
- name
(
optional Type array of string )
- Undocumented.
- Will be passed into onConnect for extension processes that are listening for the connection event.
-
Returns
- connectInfo
(
optional Port array of object )
- Undocumented.
- Port through which messages can be sent and received with the extension.
-
- name
(
optional Type array of string )
- Undocumented.
- Will be passed into onConnect for extension processes that are listening for the connection event.
-
Callback function
If you specify the callback parameter, it should specify a function that looks like this:
function(Type param1, Type param2) {...});
getViews
array of object chrome.extension.getViews(, )
Undocumented.
Returns an array of the global JavaScript objects for each of the views running inside the current extension. This includes toolstrips, background pages, and tabs.
Parameters
- paramName
(
optional Type array of paramType )
- Undocumented.
- Description of this parameter from the json schema.
-
Returns
- connectInfo
(
optional Type array of Type array of object object )
- Undocumented.
- Array of global objects
-
- name
(
optional Type array of string )
- Undocumented.
- Will be passed into onConnect for extension processes that are listening for the connection event.
-
Callback function
If you specify the callback parameter, it should specify a function that looks like this:
function(Type param1, Type param2) {...});
getBackgroundPage
object chrome.extension.getBackgroundPage(, )
Undocumented.
Returns the global JavaScript object for the background page running inside the current extension. Returns null if the extension has no backround page.
Parameters
- paramName
(
optional Type array of paramType )
- Undocumented.
- Description of this parameter from the json schema.
-
Returns
- connectInfo
(
optional Type array of object )
- Undocumented.
- Description of this parameter from the json schema.
-
- name
(
optional Type array of string )
- Undocumented.
- Will be passed into onConnect for extension processes that are listening for the connection event.
-
Callback function
If you specify the callback parameter, it should specify a function that looks like this:
function(Type param1, Type param2) {...});
getToolstrips
array of object chrome.extension.getToolstrips(, integer windowId)
Undocumented.
Returns an array of the global JavaScript objects for each of the toolstrip views running inside the current extension. If windowId is specified, returns only the toolstrips attached to the specified window.
Parameters
- windowId
(
optional Type array of integer )
- Undocumented.
- Description of this parameter from the json schema.
-
Returns
- connectInfo
(
optional Type array of Type array of object object )
- Undocumented.
- Array of global objects
-
- name
(
optional Type array of string )
- Undocumented.
- Will be passed into onConnect for extension processes that are listening for the connection event.
-
Callback function
If you specify the callback parameter, it should specify a function that looks like this:
function(Type param1, Type param2) {...});
getTabContentses
array of object chrome.extension.getTabContentses(, integer windowId)
Undocumented.
Returns an array of the global JavaScript objects for each of the tab contents views running inside the current extension. If windowId is specified, returns only the tab contentses attached to the specified window.
Parameters
- windowId
(
optional Type array of integer )
- Undocumented.
- Description of this parameter from the json schema.
-
Returns
- connectInfo
(
optional Type array of Type array of object object )
- Undocumented.
- Array of global objects
-
- name
(
optional Type array of string )
- Undocumented.
- Will be passed into onConnect for extension processes that are listening for the connection event.
-
Callback function
If you specify the callback parameter, it should specify a function that looks like this:
function(Type param1, Type param2) {...});