extension-api-compilation
Version:
Cross browser extension api
51 lines (46 loc) • 1.09 kB
JavaScript
/**
* Created by trudy on 7/6/2017.
*/
export default class Tabs {
/**
* Send message to specified object
* @param tabId {Number} id of the tab
* @param msg {Object} Object to send the message to tub
* @returns {Promise}
*/
sendMessage(tabId, msg) {
throw new Error("Not implemented");
}
/**
* Change the tab's location
* @param tabId {Number} Id of the tab
* @param url {String} Url to change page location
*/
update(tabId, url) {
throw new Error("Not implemented");
}
/**
* Executes js code on the specified tab
* @param tabId {Number} id of the tab
* @param code {String} Code to execute on the page
*/
executeScript(tabId, code) {
throw new Error("Not implemented");
}
/**
* Returns currently active tab
* @returns {Promise}
*/
getActive() {
throw new Error("Not implemented");
}
static detectBrowser() {
if (chrome)
return 'chrome';
else if (browser) {
return 'mozilla'
}
else
return undefined;
}
}