Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions background.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
chrome.tabs.onCreated.addListener(function(newTab) {
chrome.tabs.getAllInWindow(newTab.windowId, function(tabs) {
var duplicateTab = null;
tabs.forEach(function(otherTab) {
chrome.tabs.query({windowId: newTab.windowId}).then(tabs => {
let duplicateTab = null;
tabs.forEach(otherTab => {
if (otherTab.id !== newTab.id && otherTab.url === newTab.url) {
duplicateTab = otherTab;
}
Expand Down
6 changes: 2 additions & 4 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"name": "chrome-duplicate-tab-detector",
"version": "0.1.3",
"manifest_version": 2,
"manifest_version": 3,
"description": "Alters the behaviour of opening a new tab to help reduce duplicate tabs (tabs displaying the same URL)",
"background": {
"scripts": [
"background.js"
]
"service_worker": "background.js"
},
"icons": { "48": "icon48.png",
"128": "icon128.png" },
Expand Down