Content script isn't running in iframe within another extension's page

Viewed 252

Suppose that 2 extensions are installed in Google Chrome.


1st extension runs content.js on w3.org:

manifest.json:

"content_scripts": [{
    "matches": [ "https://www.w3.org/*" ],
    "all_frames": true,
    "js": [ "content.js" ]
}]

content.js:

alert('content');

2nd extension has page.html, which loads w3.org into iframe:

manifest.json:

"web_accessible_resources": ["page.html"]

page.html:

<!DOCTYPE html>
<iframe src="https://www.w3.org/"></iframe>

Now enter in address bar chrome-extension://2nd-extension-id/page.html. You will see w3.com, but content.js was not running (no alert() window). I do not see errors in console.

The question is: how to permit content script to run in this iframe?


I created Chrome issue. Status: WontFix, unfortunately. But this is can be changed in future...

1 Answers
Related