solution



async function printBookmarks(id, shift) {
//    chrome.bookmarks.getChildren(id, function(children) {
    const getBoomarksChildrensPromise = (id) => new Promise (r =>chrome.bookmarks.getChildren(id, r ));
  const childrens = await getBoomarksChildrensPromise(id);   
     for (const bookmark of childrens) {
     if (!bookmark.url) {
        document.getElementById("Output").innerHTML += shift+"<button id=\""+bookmark.id+"\" class=\"folder\" >"+bookmark.title+"";
        await printBookmarks(bookmark.id, shift+"<br>");
         console.log(bookmark.title);
             }
     }
}

old ways

function printBookmarks(id, shift) {
    chrome.bookmarks.getChildren(id, function(children) {


     for (const bookmark of children) {
     if (!bookmark.url) {
        document.getElementById("Output").innerHTML += shift+"<button id=\""+bookmark.id+"\" class=\"folder\" >"+bookmark.title+"";
        printBookmarks(bookmark.id, shift+"<br>");
         console.log(bookmark.title);
             }
     }
 });
}

// original

function printBookmarks(id, shift) {
 chrome.bookmarks.getChildren(id, function(children) {
     children.forEach(function(bookmark) {
     if (!bookmark.url) {
         document.getElementById("Output").innerHTML += shift+"<button id=\""+bookmark.id+"\" class=\"folder\" >"+bookmark.title+"";
         printBookmarks(bookmark.id, shift+"<br>");
         console.log(bookmark.title);
             }
    });
 });
}
Edit Report
Pub: 09 Oct 2021 23:06 UTC
Edit: 10 Oct 2021 00:10 UTC
Views: 97