Change getTabs to getWindows
This commit is contained in:
parent
f520372ed4
commit
9ac11c1f42
|
@ -1,5 +1,16 @@
|
||||||
export {getTabs};
|
export {getWindows};
|
||||||
|
|
||||||
function getTabs(callback) {
|
let windowCache: chrome.windows.Window[] = [];
|
||||||
chrome.tabs.query({}, callback);
|
|
||||||
|
/**
|
||||||
|
* getWindows gets all windows and their tabs, and stores them for future use.
|
||||||
|
*
|
||||||
|
* @param {(windows: chrome.windows.Window[]) => void} callback
|
||||||
|
* @returns {void}
|
||||||
|
*/
|
||||||
|
function getWindows(callback: (windows: chrome.windows.Window[]) => void): void {
|
||||||
|
chrome.windows.getAll({populate: true}, (windows : chrome.windows.Window[]) => {
|
||||||
|
windowCache = windows;
|
||||||
|
callback(windows);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue