Index: inject.preload.js |
diff --git a/inject.preload.js b/inject.preload.js |
index c35c071ce48f748401a0e3a3de6f267b51712f37..5a7ce21f9ef187a3c49249abfb5a87777de5545b 100644 |
--- a/inject.preload.js |
+++ b/inject.preload.js |
@@ -387,10 +387,15 @@ function injected(eventName, injectedIntoContentWindow) |
if (document instanceof HTMLDocument) |
{ |
- let script = document.createElement("script"); |
- script.type = "application/javascript"; |
- script.async = false; |
- script.textContent = "(" + injected + ")('" + randomEventName + "');"; |
- document.documentElement.appendChild(script); |
- document.documentElement.removeChild(script); |
+ let sandbox = window.frameElement && |
+ window.frameElement.getAttribute("sandbox"); |
+ if (typeof sandbox != "string" || sandbox.includes("allow-scripts")) |
+ { |
+ let script = document.createElement("script"); |
+ script.type = "application/javascript"; |
+ script.async = false; |
+ script.textContent = "(" + injected + ")('" + randomEventName + "');"; |
+ document.documentElement.appendChild(script); |
+ document.documentElement.removeChild(script); |
+ } |
} |