Does content_scripts match "chrome-extension: // * / *"?

I want to run the script content in an iframe with the url chrome-extension: //. I added a line to my manifest.json, which I copied from the documentation http://code.google.com/chrome/extensions/match_patterns.html

chrome-extension://*/* 

But when I reload the extension, I get a warning:

 Could not load extension from '/work/sirius/extension'. Invalid value for 'content_scripts[2].matches[0]': Invalid scheme. 

Any idea how to get this for worK?

+7
source share
3 answers

Not. Only ftp: file: http: and https: can be matched by a content script declaration.

Invalid URL patterns in any of the matches and exclude_matches fields are rejected (generating an error while trying to load the extension).

Invalid templates in the permissions option in the manifest file are ignored.

If you want to run the script in a tab from your extension, use chrome.extension.getViews in the background script. Better yet, design your extension pages to communicate effectively with each other ( example ) .

+8
source

I have the same problem, look at the http://code.google.com/chrome/extensions/match_patterns.html API, which clearly states that they accept chrome-extension://*/* , but they don’t .

They need to update the API so as not to confuse people.

+8
source

It seems that Chrome authors silently removed the ability to add content scripts to chrome-extension: pages. The documentation still says that it works and even contains examples with the chrome-extension: schema, but in reality it does not work. So, now only http: https: and ftp: work "from the window", and file: can work if the user of your extension enabled this on the Extensions page (chrome: // extensions /).

Update: now the updated documentation has been updated and does not say anything about the ability to add content scripts to chrome-extension: pages.

+5
source

All Articles