Name | Description |
---|---|
getAll | Retrieves all windows |
getCurrent | Retrieves current active window |
create | Creates new window |
Function will prepare an array of all the windows available and pass it to callback specified.
Arguments: |
|
---|
Example:
// enumerate all the browser windows, look for active window and output URL in selected tab for it
kango.browser.windows.getAll(function(wins) {
// wins is Array of KangoBrowserWindows
for (var i=0; i < wins.length; i++) {
if(wins[i].isActive()) {
wins[i].getCurrentTab(function(tab1){
// tab1 is an active tab in active window
kango.console.log(tab1.getUrl());
});
}
}
});
Retrieves currently active window and pass KangoBrowserWindow object for it to callback as argument.
Arguments: |
|
---|
Example:
// output number of tabs in active window
kango.browser.windows.getCurrent(function(win){
// win is KangoBrowserWindow object
win.getTabs(function(tabs) {
kango.console.log(tabs.length);
});
});
Creates new window with specified parameters. Created tab window be in focus after creation.
Arguments: |
|
---|
Details object:
details = {
string url // URL of the page to open
}
Example:
// open URL in new window
kango.browser.windows.create({url:'http://example.com/'});