If you need to inject multiple files with all other conditions being the same, for example to include a library, you can list all of them in the "js"
array:
"content_scripts" : [
{
"js": ["library.js", "content.js"],
"matches": ["http://*.example.com/*"]
}
]
Order matters: library.js
will be executed before content.js
.
If you need to inject the same files into multiple sites, you can provide multiple match patterns:
"matches": ["http://example.com/*", "http://example.org/*"]
If you need to inject in basically every page, you can use broad match patterns such as "*://*/*"
(matches every HTTP(S) page) or "<all_urls>"
(matches every supported page).
"content_scripts"
section is an array as well, so one can define more than one content script block:
"content_scripts" : [
{
"js": ["content.js"],
"matches": ["http://*.example.com/*"]
},
{
"js": ["something_else.js"],
"matches": ["http://*.example.org/*"]
}
]