From 04cb7f3e31c5a73aa4fd43257d83027627d652ad Mon Sep 17 00:00:00 2001 From: Genbu Hase Date: Sun, 3 Jun 2018 17:26:33 +0900 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E3=82=AF=E3=83=AA=E3=83=83?= =?UTF-8?q?=E3=82=AF=E6=99=82=E3=81=AE=E5=87=A6=E7=90=86=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- background.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/background.js b/background.js index a00e6ed..607bc28 100644 --- a/background.js +++ b/background.js @@ -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);