How do I access the bookmarks page and other chrome addresses in an extension?

I am developing an extension that replaces the new tab with a bunch of other functionality.

I have a link on a new "new tab" page. And I set the value of its attribute href

tochrome://bookmarks

But whenever I click on it, the error message "Not allowed to load local resource" appears in the console.

I also tried downloading the unzipped extension files and tried it. But still failed to access the bookmarks page. I have seen many extensions that have links that can access the bookmark page. For example, Dayboard .

How can I solve this problem?

+3


source to share


1 answer


You should be able to open source code chrome://bookmarks/

.

Create a click handler that fires chrome.tabs.create({url: "chrome://bookmarks/"})

- I just checked and works from a background page.



If you need to replace the current tab, use chrome.tabs.update

.

+2


source







All Articles