Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does content_scripts matches "chrome-extension://*/*" work?

I want to run a content script on an iframe with a chrome-extension:// URL. I added a line to my manifest.json that I copied out of the documentation http://code.google.com/chrome/extensions/match_patterns.html

 chrome-extension://*/*

But when I reload my extension I get an alert:

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

Any idea how to get this to worK?

like image 405
johnjbarton Avatar asked Apr 17 '12 17:04

johnjbarton


People also ask

Can I trust Chrome extensions?

Brave and Google Chrome are both Chromium-based web browsers; they're both compatible with most of the extensions found on the Chrome Web Store. And the vast majority of extensions you find there are safe.

Do Chrome extensions affect performance?

Chrome extensions can increase the memory usage of every page being visited, as well as memory being spent on the extension itself. This can hurt performance, especially on low-spec devices.

Do Chrome extensions work automatically?

When you turn on Google Chrome browser sync, then all your chrome extensions will be automatically installed on all your devices. Also, the settings and state for all these extensions will be the same on all your devices.

Is Chrome getting rid of extensions?

Google is planning to remove inline installation from Chrome for existing extensions starting on September 12th, and Chrome users will be redirected to the Web Store. With Chrome 71 in early December, Google is also planning to remove the inline install API method entirely.


1 Answers

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

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

Invalid patterns at the permissions option in the manifest file are ignored.

If you want to run a script on a tab from your extension, use chrome.extension.getViews in your background script. Even better, design your extension's pages such that they effectively communicate with each other (example).

like image 115
Rob W Avatar answered Jan 02 '23 16:01

Rob W