Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Update scriplet globals
Browse files Browse the repository at this point in the history
  • Loading branch information
cuba committed Feb 2, 2024
1 parent c82539f commit af6c3ed
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class ScriptFactory {
let source = [
"(function(){",
// This map is used by some of uBlock Origin's resources
"const scriptletGlobals = new Map();",
"const scriptletGlobals = (() => {\nconst forwardedMapMethods = [\"has\", \"get\", \"set\"];\nconst handler = {\nget(target, prop) { if (forwardedMapMethods.includes(prop)) { return Map.prototype[prop].bind(target) } return target.get(prop); },\nset(target, prop, value) { if (!forwardedMapMethods.includes(prop)) { target.set(prop, value); } }\n};\nreturn new Proxy(new Map(%s), handler);\n})();",
// This boolean is used by a script injected by cosmetic filters and enables that script via this boolean
// The script is found here: https://github.com/brave/adblock-resources/blob/master/resources/de-amp.js
// - Note: This script is only a smaller part (1 of 3) of de-amping:
Expand Down

0 comments on commit af6c3ed

Please sign in to comment.