Static Method Summary
Static Public Methods | ||
public static |
getActiveTab(): Promise.<chrome~Tab | null> Get an active tab with Promise. |
|
public static |
Get a tab instance specified by tab ID with Promise. |
|
public static |
withActiveTab(fn: function(tab: chrome~Tab): void) Call a function with an active tab instance. |
|
public static |
withTab(tabId: number, fn: function(tab: chrome~Tab): void) Call a function with a tab instance specified by tab ID. |
Static Public Methods
public static getActiveTab(): Promise.<chrome~Tab | null> source
Get an active tab with Promise.
Return:
Promise.<chrome~Tab | null> | Promise of active tab instance.
If there is no active tab, it resolves to |
Test:
public static getTab(tabId: number): Promise.<chrome~Tab | null> source
Get a tab instance specified by tab ID with Promise.
Params:
Name | Type | Attribute | Description |
tabId | number | Tab ID. |
Return:
Promise.<chrome~Tab | null> | Promise of tab instance.
If there is no tab for tab ID, it resolves to |
Test:
public static withActiveTab(fn: function(tab: chrome~Tab): void) source
Call a function with an active tab instance.
Note: fn
is never called when there is no active tab.
Params:
Name | Type | Attribute | Description |
fn | function(tab: chrome~Tab): void | Callback function. |
Test:
public static withTab(tabId: number, fn: function(tab: chrome~Tab): void) source
Call a function with a tab instance specified by tab ID.
Note: fn
is never called when there is no tab for tab ID.
Params:
Name | Type | Attribute | Description |
tabId | number | Tab ID. |
|
fn | function(tab: chrome~Tab): void | Callback function. |