Skip to content

Commit

Permalink
fix: Migrate onSelectionChanged to onActivated (#461)
Browse files Browse the repository at this point in the history
Fixes #153
  • Loading branch information
melink14 committed May 8, 2021
1 parent 142b3c0 commit d8a0a9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion extension/background.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
chrome.browserAction.onClicked.addListener(rcxMain.inlineToggle);
chrome.tabs.onSelectionChanged.addListener(rcxMain.onTabSelect);
chrome.tabs.onActivated.addListener((activeInfo) => {
rcxMain.onTabSelect(activeInfo.tabId);
});
chrome.runtime.onMessage.addListener(function (request, sender, response) {
switch (request.type) {
case 'enable?':
Expand Down
2 changes: 1 addition & 1 deletion extension/rikaichan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ window.rcxMain = {
return this.dict.init(this.haveNames);
},

// The callback for onSelectionChanged
// The callback for `onActivated`
// Just sends a message to the tab to enable itself if it hasn't
// already
onTabSelect: function (tabId) {
Expand Down

0 comments on commit d8a0a9d

Please sign in to comment.