Skip to content

Commit f563d56

Browse files
committed
Ignore unsubscribe links in notification footers
These URLs are the last GitHub url listed, so opening these links unsubscribes by accident.
1 parent 2da11f4 commit f563d56

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

chrome/src/inject/inject.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ function initOnHashChangeAction(domains) {
4343

4444
if (github_links.length ) {
4545
var url = github_links[github_links.length-1].href
46+
47+
// skip notification unsubscribe links:
48+
if (url.match('notifications/unsubscribe')) {
49+
url = github_links[github_links.length-2].href
50+
}
4651
// Go to thread instead of .diff link (pull request notifications)
4752
url = url.match(/\.diff/) ? url.slice(0, url.length-5) : url
4853
var link = document.createElement('a')

0 commit comments

Comments
 (0)