Skip to content

Instantly share code, notes, and snippets.

@SimonGivre
Created May 19, 2022 14:17
Show Gist options
  • Save SimonGivre/94808a6a3b5ea6fe09343526286ec98a to your computer and use it in GitHub Desktop.
Save SimonGivre/94808a6a3b5ea6fe09343526286ec98a to your computer and use it in GitHub Desktop.
function dumpBookmarks(query) {
var bookmarkTreeNodes = chrome.bookmarks.getTree(
function(bookmarkTreeNodes) {
var i;
var badOnes = bookmarkTreeNodes[0].children[0].children;
for (i = 0; i < badOnes.length; i++) {
var badOne = badOnes[i];
if (badOne.title) {
if (query && !badOne.children) {
if (String(badOne.title).indexOf(query) != -1) {
chrome.bookmarks.remove(String(badOne.id));
}
}
}
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment