diff --git a/src/background/start.js b/src/background/start.js index 6ac8f0d58..3c703aa4b 100644 --- a/src/background/start.js +++ b/src/background/start.js @@ -1626,6 +1626,55 @@ function start(browser) { chrome.tts.stop(); }; + self.manageWindow = function(message, sender, sendResponse) { + console.log("hello"); + + // chrome.windows.getAll({ + // populate: false + // }, function(windows) { + // windows.forEach(function(w) { + // console.log(w.id); + // }); + // }); + + var wid; + // chrome.storage.local.set({ key: value }).then(() => { + // console.log("Value is set"); + // }); + + + + if (message.bookmark) + { + // console.log("bookmarking current window: " + wid); + // return wid; + chrome.windows.getCurrent({ + populate: false + }, function(w) { + console.log("getting current window"); + console.log(w.id); + // return w.id + _response(message, sendResponse, { + tabs: w.id + }); + + }); + return + } + else { + console.log("opening bookmarked window: " + message.wid); + chrome.windows.update(message.wid, { + focused: true + }); + console.log("opened bookmarked window: " + message.wid); + } + + //console.log(chrome.windows.getLastFocused({ populate: true })); + + + }; + + self.openIncognito = function(message, sender, sendResponse) { chrome.windows.create({"url": message.url, "incognito": true}); };