Class: Window

zombie/webbrowser~ Window

(protected) new Window()

A browser window, or a tab
Source:
Example
require('zombie/webbrowser').openPrivateWindow('about:')
.then(window => {
	console.log(window.uri);
})
.catch(e => {
	console.exception(e); // failed
});

Members

(readonly) isPrivate :bool

Whether this window is private (Private Browsing)
Type:
  • bool
Source:

uri :string

The URI of the window
Type:
  • string
Source:
Example
// writable since 0.4.0
window.uri = 'about:';
window.waitForReload()
.then(...)

Methods

close() → {Promise}

Close the window
Source:
Returns:
Type
Promise

reload() → {Promise}

Reload this tab
Source:
Returns:
Type
Promise

runScript(callback, …args) → {Promise}

Run a script inside this tab
Parameters:
Name Type Attributes Description
callback function The script to run
args * <repeatable>
Passed to the callback
Source:
Returns:
Resolves to the result of the callback
Type
Promise
Example
let promise = w.runScript(function (arg1, arg2) {
	console.log(document.title);
	return 'result';
}, 'arg1', 'arg2');

waitForReload() → {Promise}

Wait until the tab is reloaded
Source:
Returns:
Type
Promise