Skip to content

Instantly share code, notes, and snippets.

@derekaug
Last active April 1, 2022 16:40
Show Gist options
  • Save derekaug/e2fb46d9cf8dbc6c680b0bdcd36432c4 to your computer and use it in GitHub Desktop.
Save derekaug/e2fb46d9cf8dbc6c680b0bdcd36432c4 to your computer and use it in GitHub Desktop.
Github Notifications Housekeeping Bookmarklet
javascript:%22use%20strict%22;void%20function(){document.querySelectorAll(%22.notifications-list-item%22).forEach(function(a){0%3CArray.from(a.querySelectorAll(%22.octicon-git-merge%22)).length%26%26a.querySelector(%22[type=\%22checkbox\%22]%22).click(),0%3CArray.from(a.querySelectorAll(%22.octicon-git-pull-request-closed%22)).length%26%26a.querySelector(%22[type=\%22checkbox\%22]%22).click(),0%3CArray.from(a.querySelectorAll(%22.octicon-git-pull-request-draft%22)).length%26%26a.querySelector(%22[type=\%22checkbox\%22]%22).click(),0%3CArray.from(a.querySelectorAll(%22.octicon-issue-closed%22)).length%26%26a.querySelector(%22[type=\%22checkbox\%22]%22).click()})}();
document.querySelectorAll(".notifications-list-item").forEach(function (b) {
0 < Array.from(b.querySelectorAll(".octicon-git-merge")).length && b.querySelector('[type="checkbox"]').click();
0 < Array.from(b.querySelectorAll(".octicon-git-pull-request-closed")).length && b.querySelector('[type="checkbox"]').click();
0 < Array.from(b.querySelectorAll(".octicon-git-pull-request-draft")).length && b.querySelector('[type="checkbox"]').click();
0 < Array.from(b.querySelectorAll(".octicon-issue-closed")).length && b.querySelector('[type="checkbox"]').click();
});
@derekaug
Copy link
Author

Copy "compiled" code from "housekeeping-bookmarklet.txt" and add as a bookmark in your browser. Then, on https://github.com/notifications you can click that bookmark to select all notifications that have been merged, closed, or are in draft on the current page.

Screen.Recording.2022-01-19.at.09.07.55.mov

@derekaug
Copy link
Author

derekaug commented Jan 19, 2022

Feel free to edit the source to make it work to your liking, I "compiled" it using this tool: https://chriszarate.github.io/bookmarkleter/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment