From d4803806508993e0e2b4d0f67f4c1daf2fd3f4ca Mon Sep 17 00:00:00 2001 From: csilby01 Date: Fri, 26 Apr 2024 17:46:01 -0700 Subject: [PATCH] Added right click event listener --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index 24f0e85..d9e987d 100644 --- a/index.js +++ b/index.js @@ -750,6 +750,10 @@ HTMLElement.prototype.onClick = function(func) { this.addEventListener("click", func) return this } +HTMLElement.prototype.onRightClick = function(func) { + this.addEventListener("contextmenu", func) + return this +} HTMLElement.prototype.onHover = function(cb) { this.addEventListener("mouseover", () => cb(true))