Contentscripts are not executed for frames within extension popups even with all_frames set to true.
See Feedback Assistant report #9637605
Manifest.json:
{
"manifest_version": 2,
"name": "all_frames contentscript popup issue",
"description": "all_frames contentscript popup issue",
"version": "1.0",
"permissions": [
"<all_urls>"
],
"content_scripts": [{
"all_frames": true,
"matches": ["<all_urls>"],
"js": ["/content-script.js"]
}],
"icons": {
"16": "/icon.png"
},
"browser_action": {
"browser_style": false,
"default_popup": "/popup.html"
}
}
popup.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>all_frames contentscript popup issue</title>
</head>
<body>
<iframe src="https://www.google.com/error"></iframe>
</body>
</html>
content-script.js:
'use strict';
(function () {
document.head.textContent = '';
document.body.textContent = '';
document.body.style.cssText = 'background: red !important';
})();