Reputation: 6105
I have read google's developer chrome.bookmarks doc and googled it, still can't find a way to access chrome.bookmarks
in Chrome Console.
But I do can access chrome
in Chrome Console
console.log(chrome) //run this in Chrome Console
// Object {app: Object, webstore: Object, runtime: Object, loadTimes: function, csi: function}
But try access chrome.bookmarks
the same way, returned print undefined
console.log(chrome.bookmarks)
any suggestion?
Upvotes: 2
Views: 3130
Reputation: 33296
There are multiple consoles for your extension. To access chrome.bookmarks
from the console, you will need to be using a DevTools which is associated with a page in the background context (e.g. the background page, or popup, etc.). You will also need to have declared the bookmarks
permission in your manifest.json.
Example of accessing chrome.bookmarks
from the background page's DevTools:
Upvotes: 1