Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rebloor authored Nov 1, 2024
2 parents b2e1f8d + 18238c1 commit 80bc914
Show file tree
Hide file tree
Showing 11 changed files with 711 additions and 739 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();
Loading

0 comments on commit 80bc914

Please sign in to comment.