From 1d3572c3d959aaff75a3ac6dd83bbc3d20f45073 Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Thu, 22 Jul 2021 14:52:18 +0300 Subject: [PATCH] Prevent firefox image dragging --- src/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/index.ts b/src/index.ts index 804b32e3..cb183242 100644 --- a/src/index.ts +++ b/src/index.ts @@ -154,6 +154,14 @@ console.timeEnd('get storage1'); */ }); } + // prevent firefox image dragging + document.addEventListener('dragstart', (e) => { + if((e.target as HTMLElement)?.tagName === "IMG") { + e.preventDefault(); + return false; + } + }); + if(userAgent.isApple) { if(userAgent.isSafari) { document.documentElement.classList.add('is-safari');