25

When you're writing the manifest.json file, you have to specify matches for your content scripts. The http and https work fine, but if I try to include chrome://*/* or any variant of it, I get an error that I'm attempting to use an invalid scheme for my matches.

Is it not allowed?

temporary_user_name
  • 35,956
  • 47
  • 141
  • 220
  • Do you need this permission for private use, or in a public extension? – Rob W Sep 27 '13 at 10:57
  • 1
    In Chrome 41.0.2272.76 m, `matches: [ "chrome://*/*" ]` was the way to go. Hopefully I won't have any trouble uploading the extension to the store because of this. – Călin Darie Mar 07 '15 at 07:06

4 Answers4

35

By default you cannot run on a chrome:// url page.

However, there is an option in chrome://flags/#extensions-on-chrome-urls:

Extensions on chrome:// URLs (Mac, Windows, Linux, Chrome OS, Android)
Enables running extensions on chrome:// URLs, where extensions explicitly request this permission.

You still have to specify pages that your extension can run on and wildcards are not accepted - so you have to specify the full URL eg chrome://extensions/

Dennis
  • 56,821
  • 26
  • 143
  • 139
Andrew Hall
  • 3,058
  • 21
  • 30
  • 5
    Note that this flag is considered a "bad flag", and will trigger a warning "stability and security will suffer" the next time Chrome is restarted. – Métoule Sep 27 '13 at 10:51
  • 1
    @Metoule: You can add the `--test-type` command-line switch in order to suppress the warning banner. – Bass Feb 09 '17 at 10:06
  • I understand it will be strong violation of security but need to know is it possible to run the extension on the Privacy Error page (for example when site use self signed ssl certificate)? What permissions / URL matches should I use in manifest ? didn't work – arty Apr 23 '17 at 07:37
  • @Andrew Hall I'm looking for official documentation on not being able to run extensions on `chrome://` pages and couldn't find one. Do you happen to have links? – Obay Nov 28 '17 at 07:55
  • @Obay Sorry, this is 4 years old. The docs (and maybe implementation) have changed – Andrew Hall Nov 28 '17 at 14:10
  • 2
    Yes, this is not working anymore (Chrome Canary 69). – Igor Jul 20 '18 at 17:14
6

The authorized schemes for matches are http, https, file, ftp.
Therefore, chrome is not a valid scheme.

wOxxOm
  • 65,848
  • 11
  • 132
  • 136
Métoule
  • 13,062
  • 2
  • 56
  • 84
1

Yes, it is not allowed. You can't link to them from hrefs on a webpage either.

James
  • 4,146
  • 1
  • 20
  • 35
0

@andrew-hall's solution doesn't work any more. Trying many options I was frustrated. Then thanks to @thomas-mueller, I found a chrome extension which can access chrome://extensions:

Here is the manifest of it:

{
    "update_url": "https://clients2.google.com/service/update2/crx",
    "name": "Disable All Extensions",
    "manifest_version": 3,
    "version": "1.4.3",
    "description": "Disable/Enable your chrome extensions with the click of a button.",
    "permissions": [
        "contextMenus",
        "management",
        "storage"
    ],
    "background": {
        "service_worker": "./src/background.js",
        "type": "module"
    },
    "icons": {
        "16": "./public/images/appOn_16.png",
        "48": "./public/images/appOn_48.png",
        "128": "./public/images/appOn_128.png"
    },
    "action": {
        "default_icon": "./public/images/appOff_16.png",
        "default-popup": "./public/index.html"
    },
    "author": "Blinkzy"
}

It's interesting it doesn't have matches whatsoever(not even content_scripts), and I was thinking it to be a mandatory field.

ishandutta2007
  • 16,676
  • 16
  • 93
  • 129