| Name | Description |
|---|---|
| getAll | Retrieves all tabs |
| getCurrent | Retrieves current active tab |
| create | Creates new tab |
Function will prepare an array of all the tabs available and pass it to callback specified.
| Arguments: |
|
|---|
Example:
// enumerate all the browser tabs and log their urls to console
kango.browser.tabs.getAll(function(tabs) {
// tabs is Array of KangoBrowserTab
for(var i = 0; i < tabs.length; i++){
kango.console.log(tabs[i].getUrl());
}
});
Retrieves currently active tab and pass KangoBrowserTab object for it to callback as argument.
| Arguments: |
|
|---|
Example:
// output current tab url to console
kango.browser.tabs.getCurrent(function(tab) {
// tab is KangoBrowserTab object
kango.console.log(tab.getUrl());
});
Creates new tab with specified parameters.
| Arguments: |
|
|---|
Details object:
details = {
string url, // URL of the tab to open
boolean focused // Tab will be active or not. Default is true.
}
Example:
// open URL in new tab
kango.browser.tabs.create({url:'http://example.com/'});