diff options
Diffstat (limited to 'src/scripts/stop-blocking.ts')
| -rw-r--r-- | src/scripts/stop-blocking.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/scripts/stop-blocking.ts b/src/scripts/stop-blocking.ts new file mode 100644 index 0000000..57357f8 --- /dev/null +++ b/src/scripts/stop-blocking.ts @@ -0,0 +1,21 @@ +const proxiedBind = $.prototype.bind; + +$.prototype.bind = function() { + if (arguments[0].trim() === "cut copy paste") { + arguments[1] = (e: any) => {}; + } + return proxiedBind.apply(this, Array.from(arguments) as any); +} + +const proxiedKeydown = $.prototype.keydown; + +$.prototype.keydown = function() { + arguments[0] = (e: any) => true; + return proxiedKeydown.apply(this, Array.from(arguments) as any); +} + +document.addEventListener("DOMContentLoaded", () => { + $.prototype.bind = proxiedBind; + $.prototype.keydown = proxiedKeydown; + document.oncontextmenu = new Function("return true") as any; +}); |
