Interact with chrome bookmarks outside of extensions

417 views Asked by At

How would I interact with the Chrome Bookmarks API outside of an extension? I have tried to get this to work and can't get the call to work outside of an extension. Is there a library that can help with this? Or something that I need to link in instead?

I've been using the below code to do a call and can't get anything from it unless I'm using it in a bookmark.

chrome.bookmarks.getTree(function(bookmarkTree){
            console.log(bookmarkTree); 
        })

I can't get it to interact at all.

For reference, I'm using Angular and Node.

1

There are 1 answers

1
IronFlare On

Unfortunately, Chrome's security restrictions prevent any non-extension-based JavaScript from accessing the bookmarks API. Chrome has a lot of seemingly developer-unfriendly caveats like this, but they are in the end user's best interest. There are many more malicious things that a script could do with access to bookmarks than there are legitimate ones.