Open timii opened 2 years ago
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)
}
}
});
It only happens when creating a custom area or full page screenshot. The call to send the image to the new tab is fired twice, as seen in the following screenshot:
After creating either a full page or custom area screenshot, two tabs open for showing the screenshot instead of just one.