diff --git a/src/pageServices/contentScripts/contextmenu.js b/src/pageServices/contentScripts/contextmenu.js index bc65cd71..f6bc48b1 100644 --- a/src/pageServices/contentScripts/contextmenu.js +++ b/src/pageServices/contentScripts/contextmenu.js @@ -586,7 +586,8 @@ export const runContextMenu = () => { if (isMacPlatform && event.ctrlKey) return; const highlightTarget = event.target.closest('[jdn-highlight=true]'); - if (!highlightTarget.classList.contains('jdn-active')) return; + if (!highlightTarget) return; + if (highlightTarget && !highlightTarget.classList.contains('jdn-active')) return; event.preventDefault(); diff --git a/src/pageServices/contentScripts/selectable.js b/src/pageServices/contentScripts/selectable.js index 3830aeb8..2758e756 100644 --- a/src/pageServices/contentScripts/selectable.js +++ b/src/pageServices/contentScripts/selectable.js @@ -179,13 +179,14 @@ export const selectable = () => { const menuTarget = e.target.closest(".context-menu"); if (menuTarget) return; - if (e.button === 2) return; - self.options.start && self.options.start(e); if (self.options.key && !e[self.options.key]) return; self.options.onDeselect && self.selectedItems.size && self.options.onDeselect(Array.from(self.selectedItems)); - + document.body.classList.add("s-noselect"); + + if (e.button === 2) return; + self.ipos = [e.pageX, e.pageY]; if (!rb()) { const gh = document.createElement("div");