A workaround to restore some original Playwright functionality. Forces Playwright to run in "God mode", allowing it to bypass CORS restrictions, access shadow roots (with element.shadowRootUnl), access undocumented JS browser methods, modify DOM without `allowMainWorld`, & restore some unsupported Playwright functionality. Note: `forceScopeAccess` is not detectable/visible to the page unless the dom is directly modified (elements are added or removed).
14 lines
547 B
Diff
14 lines
547 B
Diff
diff --git a/dom/webidl/Element.webidl b/dom/webidl/Element.webidl
|
|
index 7163fac826..c0c201e29d 100644
|
|
--- a/dom/webidl/Element.webidl
|
|
+++ b/dom/webidl/Element.webidl
|
|
@@ -288,6 +288,9 @@ partial interface Element {
|
|
[BinaryName="shadowRootByMode"]
|
|
readonly attribute ShadowRoot? shadowRoot;
|
|
|
|
+ [Func="Document::IsCallerChromeOrAddon", BinaryName="shadowRoot"]
|
|
+ readonly attribute ShadowRoot? shadowRootUnl;
|
|
+
|
|
[Func="Document::IsCallerChromeOrAddon", BinaryName="shadowRoot"]
|
|
readonly attribute ShadowRoot? openOrClosedShadowRoot;
|
|
|