aboutsummaryrefslogtreecommitdiffstats
path: root/src/scripts/stop-blocking.ts
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-13 11:35:08 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-13 11:35:08 +0530
commit600c337b1cdc884aebf59083eb57b178b43441ce (patch)
treed1f3cb7eb1020bcdcd66d9dbf0279f79d5856332 /src/scripts/stop-blocking.ts
parent98e7019c61ea0ffe344ef7ce809d38d62254a9fc (diff)
downloadbanglar-bhumi-utils-600c337b1cdc884aebf59083eb57b178b43441ce.tar.gz
banglar-bhumi-utils-600c337b1cdc884aebf59083eb57b178b43441ce.zip
docs: added some documentation comments to all functions
Diffstat (limited to 'src/scripts/stop-blocking.ts')
-rw-r--r--src/scripts/stop-blocking.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/scripts/stop-blocking.ts b/src/scripts/stop-blocking.ts
index b8f4783..3fa3de6 100644
--- a/src/scripts/stop-blocking.ts
+++ b/src/scripts/stop-blocking.ts
@@ -1,5 +1,12 @@
+/**
+ * Proxies jQuery's `.bind()` (for the `"cut copy paste"` event) and
+ * `.keydown()` so that the website's copy/paste/right-click blocking
+ * is disabled. Reverts the prototypes after patching to avoid
+ * interfering with other code.
+ */
document.addEventListener("DOMContentLoaded", () => {
const proxiedBind = $.prototype.bind;
+ /** Proxies jQuery `.bind()` to no-op the `"cut copy paste"` event. */
$.prototype.bind = function() {
if (arguments[0].trim() === "cut copy paste") {
arguments[1] = (_: any) => {};
@@ -9,6 +16,7 @@ document.addEventListener("DOMContentLoaded", () => {
}
const proxiedKeydown = $.prototype.keydown;
+ /** Proxies jQuery `.keydown()` so all key presses are allowed. */
$.prototype.keydown = function() {
arguments[0] = (_: any) => true;