Skip to content

Commit

Permalink
通知クリック時の処理実装
Browse files Browse the repository at this point in the history
  • Loading branch information
GenbuHase committed Jun 3, 2018
1 parent 62fd5e6 commit 04cb7f3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ const notifyListeningInfo = (tabId) => {
title,
message: url,
iconUrl: "icons/icon48.png"
}, currentId => {
chrome.notifications.onClicked.addListener(notificationId => {
if (notificationId === currentId) {
chrome.tabs.highlight({ windowId: tabInfo.windowId, tabs: tabInfo.index });
chrome.notifications.clear(currentId);
}

chrome.notifications.onClicked.removeListener(event);
});
});

tootListeningInfo(title, url);
Expand Down

0 comments on commit 04cb7f3

Please sign in to comment.