{
"version": "1.0.0",
"name": "PAC",
"manifest_version": 3,
"permissions": [
"webRequest",
"webRequestAuthProvider"
],
"host_permissions": [
"<all_urls>"
],
"background": {
"service_worker": "background.js"
},
"content_scripts": [{
"all_frames": true,
"js": [
"content.js"
],
"matches": [ "<all_urls>" ],
"run_at": "document_start"
}],
"web_accessible_resources": [{
"resources": ["interceptor.js"],
"matches": ["<all_urls>"]
}]
}
<!DOCTYPE html>
<html lang="ru">
<head></head>
<body>
<div id="example">
<div>
#shadow-root (close)
<iframe src="Другой домен">
#document
<!DOCTYPE html>
<html lang="en-US" dir="ltr">
<head></head>
<body>
#shadow-root (close)
<div>
<div id="content"><div>
<div>
</body>
</html>
</iframe>
<div>
</div>
</body>
</html>
#content.
var shadowRoot = chrome.dom.openOrClosedShadowRoot(document.getElementById("example").firstChild);
console.log(shadowRoot.firstChild.contentDocument)
contentDocument - выдает null.
content.document.getElementById("example")
.firstChild.openOrClosedShadowRoot.firstChild.contentDocument
.body.openOrClosedShadowRoot.querySelector("#content")