Skip to content

Instantly share code, notes, and snippets.

@butchhoward
Created November 16, 2017 23:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save butchhoward/ec971481c1c9d03c31d7a34ac17e9bab to your computer and use it in GitHub Desktop.
Save butchhoward/ec971481c1c9d03c31d7a34ac17e9bab to your computer and use it in GitHub Desktop.
google bookmarks - make bookmark links open in a new tab
function MakeBookmarkLinksOpenInNewWindow() {
if (window.location.href.includes('/bookmarks/')) {
var links = document.getElementsByTagName("a");
for (var i = 0; i < links.length; i++) {
if (links[i].href.startsWith("https://www.google.com/url")) {
links[i].target = "_blank";
}
}
}
}
MakeBookmarkLinksOpenInNewWindow();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment