Skip to content

Commit

Permalink
Merge branch 'main' into native-update
Browse files Browse the repository at this point in the history
  • Loading branch information
rebloor authored Oct 18, 2024
2 parents d2d2255 + 1d8a18a commit 6fc3408
Show file tree
Hide file tree
Showing 5 changed files with 617 additions and 650 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 6fc3408

Please sign in to comment.