Change getTabs to getWindows
This commit is contained in:
parent
f520372ed4
commit
9ac11c1f42
|
@ -1,5 +1,16 @@
|
|||
export {getTabs};
|
||||
export {getWindows};
|
||||
|
||||
function getTabs(callback) {
|
||||
chrome.tabs.query({}, callback);
|
||||
let windowCache: chrome.windows.Window[] = [];
|
||||
|
||||
/**
|
||||
* 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