Skip to content

Commit

Permalink
Manage window
Browse files Browse the repository at this point in the history
  • Loading branch information
cibinmathew committed Sep 24, 2023
1 parent 08369cd commit 46d8cd7
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions src/background/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -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});
};
Expand Down

0 comments on commit 46d8cd7

Please sign in to comment.