summaryrefslogtreecommitdiff
path: root/src/content/webglHook.js
diff options
context:
space:
mode:
authorhackademix2018-08-15 16:41:55 +0200
committerhackademix2018-08-16 23:43:36 +0200
commit57d883d63e9b8232e275dac7eec24f84c040dd24 (patch)
treea4a9f05f0744ccef23e31643f80c400abe0dab37 /src/content/webglHook.js
parent2c75eedadddd8bda0522cddaf119e1e5c621c7c2 (diff)
downloadnoscript-57d883d63e9b8232e275dac7eec24f84c040dd24.tar.gz
noscript-57d883d63e9b8232e275dac7eec24f84c040dd24.tar.xz
noscript-57d883d63e9b8232e275dac7eec24f84c040dd24.zip
Policy serialization using the contentScripts API.
Diffstat (limited to 'src/content/webglHook.js')
-rw-r--r--src/content/webglHook.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/content/webglHook.js b/src/content/webglHook.js
index d4c064a..67f31eb 100644
--- a/src/content/webglHook.js
+++ b/src/content/webglHook.js
@@ -1,5 +1,6 @@
-{
- debug("WebGL Hook", document.URL, document.documentElement && document.documentElement.innerHTML); // DEV_ONLY
+ns.on("perms", ns => {
+ debug("WebGL Hook", document.URL, document.documentElement && document.documentElement.innerHTML, ns.perms.CURRENT); // DEV_ONLY
+ if (ns.allows("webgl")) return;
let proto = HTMLCanvasElement.prototype;
let getContext = proto.getContext;
exportFunction(function(type, ...rest) {
@@ -23,6 +24,6 @@
return {};
}
return getContext.call(this, type, ...rest);
- }, proto, {defineAs: "getContext"});
- document.URL;
-}
+ }, proto, {defineAs: "getContext"});
+});
+document.URL;