gr56
gr56

Reputation: 23

Injecting code into Chrome pages

When I inject a JavaScript file using

"content_scripts": [
    {
        "matches": ["<all_urls>"],
        "js": ["inject.js"]
    }
]

in manifest.json, it doesn't inject it to Chrome pages, like chrome://extensions/.

Is there any solution for it?

Upvotes: 1

Views: 654

Answers (2)

jdavid.net
jdavid.net

Reputation: 751

While you can not modify other extensions you can modify other chrome://pages. This process is called, Page Overriding.

http://code.google.com/chrome/extensions/override.html

An extension can replace any one of the following pages:

  • Bookmark Manager: The page that appears when the user chooses the Bookmark Manager menu item from the wrench menu or, on Mac, the Bookmark Manager item from the Bookmarks menu. You can also get to this page by entering the URL chrome://bookmarks.
  • History: The page that appears when the user chooses the History menu item from the Tools (wrench) menu or, on Mac, the Show Full History item from the History menu. You can also get to this page by entering the URL chrome://history.
  • New Tab: The page that appears when the user creates a new tab or window. You can also get to this page by entering the URL chrome://newtab.

Upvotes: 2

Darin
Darin

Reputation: 2121

Google doesn't allow extensions to work with certain URI like chrome://extensions/ for security and development reasons. See Can extensions modify chrome:// URLs?.

Upvotes: 7

Related Questions