Skip to content

Commit

Permalink
Fix patters for tabs query #13
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Apr 3, 2020
1 parent abf61a7 commit 5226202
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions background.js
@@ -1,6 +1,4 @@
const notificationsUrl = "https://github.com/notifications";
// see: https://wiki.developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns
const notificationsUrlPattern = "https://github.com/notifications/*";
var count = 0;

function update() {
Expand Down Expand Up @@ -99,7 +97,11 @@ setInterval(update, 1000 * 60);

browser.browserAction.onClicked.addListener((e) => {
browser.tabs.query({
'url': notificationsUrlPattern
'url': [
notificationsUrl,
`${notificationsUrl}?*`,
`${notificationsUrl}/*`,
]
}, (tabs) => {
if (!tabs.length) {
browser.tabs.create({
Expand Down

0 comments on commit 5226202

Please sign in to comment.