Skip to content

Commit f8e7d4c

Browse files
committed
Fix duplicate URL counting issue in badge text
1 parent 1c36f05 commit f8e7d4c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

background.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ const queryParams = [
6060

6161
// Function to add a modified URL
6262
function addModifiedUrl(url) {
63-
modifiedUrls.add(url);
64-
incrementCount(); // Increment the counter and update the badge text when a new URL is added
63+
if (!modifiedUrls.has(url)) {
64+
modifiedUrls.add(url);
65+
chrome.browserAction.setBadgeText({text: modifiedUrls.size.toString()});
66+
}
6567
}
6668

6769
// Function to get modified URLs

0 commit comments

Comments
 (0)