Created
May 19, 2022 14:17
-
-
Save SimonGivre/94808a6a3b5ea6fe09343526286ec98a to your computer and use it in GitHub Desktop.
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
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