Javascript (typescript) Chrome extension, function callback as promises?
问题 for a code like this let anotherFolder='whatever'; let anotherFolder2='whatever'; chrome.bookmarks.create( {title:'whatever2'}, function( parentFolder ) { chrome.bookmarks.move( anotherFolder, {parentId: parentFolder.id}, function() { chrome.bookmarks.removeTree( anotherFolder2, function() { resolve(); }); }); }); can I transform it to chain functions? Something like let anotherFolder='whatever'; let anotherFolder2='whatever'; return new Promise(function(resolve){ chrome.bookmarks.create(