Created
February 12, 2023 13:14
-
-
Save jlevon/a70681ca49567483acb632755aacd9a2 to your computer and use it in GitHub Desktop.
open all gerrit files in a new tab bookmarklet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (function() { | |
var dl = document.querySelectorAll(".pathLink"); | |
if (!dl.length) { | |
dl = document.querySelectorAll("a.gr-file-list"); | |
} | |
if (!dl.length) { | |
dl = document.querySelectorAll(".path"); | |
} | |
if (!dl.length) { | |
dl = document.querySelectorAll(".com-google-gerrit-client-change-FileTable-FileTableCss-pathColumn > a"); | |
} | |
if (!dl.length) { | |
dl = document.querySelector('body > gr-app').shadowRoot.querySelector('gr-app-element').shadowRoot.querySelector('gr-change-view').shadowRoot.querySelector('gr-file-list').shadowRoot.querySelectorAll('.pathLink'); | |
} | |
if (!dl.length) { | |
alert('no links'); | |
} else { | |
if (confirm('Open ' + dl.length + ' links in new windows?')) { | |
for (var i = 0; i < dl.length; ++i) { | |
window.open(dl[i].href); | |
} | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment