Skip to content

Commit

Permalink
Merge pull request #561 from s-c-p/patch-1
Browse files Browse the repository at this point in the history
Illustrative function name
  • Loading branch information
dotproto committed Jul 13, 2024
2 parents 91c8d7e + 5dcff0b commit 711f647
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bookmark-it/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ browser.browserAction.onClicked.addListener(toggleBookmark);
/*
* Switches currentTab and currentBookmark to reflect the currently active tab
*/
function updateActiveTab(tabs) {
function updateAddonStateForActiveTab(tabs) {

function isSupportedProtocol(urlString) {
let supportedProtocols = ["https:", "http:", "ftp:", "file:"];
Expand Down Expand Up @@ -68,19 +68,19 @@ function updateActiveTab(tabs) {
}

// listen for bookmarks being created
browser.bookmarks.onCreated.addListener(updateActiveTab);
browser.bookmarks.onCreated.addListener(updateAddonStateForActiveTab);

// listen for bookmarks being removed
browser.bookmarks.onRemoved.addListener(updateActiveTab);
browser.bookmarks.onRemoved.addListener(updateAddonStateForActiveTab);

// listen to tab URL changes
browser.tabs.onUpdated.addListener(updateActiveTab);
browser.tabs.onUpdated.addListener(updateAddonStateForActiveTab);

// listen to tab switching
browser.tabs.onActivated.addListener(updateActiveTab);
browser.tabs.onActivated.addListener(updateAddonStateForActiveTab);

// listen for window switching
browser.windows.onFocusChanged.addListener(updateActiveTab);
browser.windows.onFocusChanged.addListener(updateAddonStateForActiveTab);

// update when the extension loads initially
updateActiveTab();
updateAddonStateForActiveTab();

0 comments on commit 711f647

Please sign in to comment.