user3926446
user3926446

Reputation:

How to access bookmarks page and other chrome urls in an extension?

I'm developing an extension which replaces the new tab page with a set of other features.

I have a link on the new "new tab" page. And I've set the value of its href attribute to chrome://bookmarks

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

I also tried loading the unpacked extension files and tried it out. But still wasn't able to access the bookmarks page. I've seen many extensions which have links that can access the bookmarks page. For example, Dayboard.

How do I go about this problem?

Upvotes: 3

Views: 1056

Answers (1)

Xan
Xan

Reputation: 77482

You should be able to open chrome://bookmarks/ programmatically.

Make an click handler that triggers chrome.tabs.create({url: "chrome://bookmarks/"}) - I just checked and it works from a background page.

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

Upvotes: 2

Related Questions