Two tabs opening when creating screenshot
Opened this issue · 3 comments
timii commented
After creating either a full page or custom area screenshot, two tabs open for showing the screenshot instead of just one.
timii commented
Found a workaround: delete one of the two created tabs after the tab has been created. It's a pretty bad solution, but it works for now and also adds the feature to delete the old tab when creating a screenshot in the same tab
Source code of current solution:
chrome.tabs.query({ currentWindow: true, url: "url_of_newly_created_tab" }, function (tabs) {
for (var i = 0; i < tabs.length; i++) {
if (tabs[i].id !== createdTab.id && tabs[i].index > currentTabIndex + 1) {
chrome.tabs.remove(tabs[i].id)
}
}
});
timii commented