Merge pull request #10075 from alexstrat/fix/fix-content_scripts-match
Fix content scripts matches
This commit is contained in:
commit
bd87982b5c
1 changed files with 1 additions and 3 deletions
|
@ -26,9 +26,7 @@ const runContentScript = function (extensionId, url, code) {
|
||||||
// Run injected scripts.
|
// Run injected scripts.
|
||||||
// https://developer.chrome.com/extensions/content_scripts
|
// https://developer.chrome.com/extensions/content_scripts
|
||||||
const injectContentScript = function (extensionId, script) {
|
const injectContentScript = function (extensionId, script) {
|
||||||
for (const match of script.matches) {
|
if (!script.matches.some(matchesPattern)) return
|
||||||
if (!matchesPattern(match)) return
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const {url, code} of script.js) {
|
for (const {url, code} of script.js) {
|
||||||
const fire = runContentScript.bind(window, extensionId, url, code)
|
const fire = runContentScript.bind(window, extensionId, url, code)
|
||||||
|
|
Loading…
Reference in a new issue