/**
Zombie Navigator API (ZAPI) documentation
@copyright
Copyright © 2015 Zombie Navigator Developers
<br /><br />
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
<br /><br />
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
<br /><br />
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see {@link http://www.gnu.org/licenses/}.
<br /><br />
The latest version of the GNU AGPL should be available here:
{@link https://www.gnu.org/licenses/agpl.html}
@file
@module zombie/webbrowser
@license AGPL-3.0+
*/
/*
This is not a script but a JSDoc documentation source.
*/
/**
Open a window (tab)
@param {string} uri
@returns {Promise} Resolves to {@link Window}
@public
*/
var openWindow = function () {};
/**
Open a private window (tab)
@param {string} uri
@returns {Promise} Resolves to {@link Window}
@public
*/
var openPrivateWindow = function () {};
/**
Close all windows opened by the Zombie script
This doesn't close any other windows, so if the user moves a Zombie tab into
another window, that tab is not closed here.
@returns {Promise}
@public
*/
var closeAll = function () {};
/**
A browser window, or a tab
@example
require('zombie/webbrowser').openPrivateWindow('about:')
.then(window => {
console.log(window.uri);
})
.catch(e => {
console.exception(e); // failed
});
@class
@protected
*/
var Window = function Window () {
/**
Whether this window is private (Private Browsing)
@type {bool}
@public
@readonly
*/
this.isPrivate = false;
/**
The URI of the window
@type {string}
@public
@readonly
*/
this.uri = false;
/**
Close the window
@returns {Promise}
@public
*/
this.close = function () {};
/**
Wait until the tab is reloaded
@returns {Promise}
@public
*/
this.waitForReload = function () {};
/**
Run a script inside this tab
@example
let promise = w.runScript(function (arg1, arg2) {
console.log(document.title);
return 'result';
}, 'arg1', 'arg2');
@param {function} callback The script to run
@param {...*} args Passed to the callback
@returns {Promise} Resolves to the result of the callback
@public
*/
this.runScript = function () {};
/**
Reload this tab
@returns {Promise}
@public
*/
this.reload = function () {};
};
// vim: ts=4 noet ai ft=js