A Universal Script to Re-Enable the Selection and Copying

Enables select, right-click, copy and drag on pages that disable them. Enhanced Feature: Alt Key HyperLink Text Selection

当前为 2021-06-22 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name A Universal Script to Re-Enable the Selection and Copying
  3. // @name:zh-TW A Universal Script to Re-Enable the Selection and Copying
  4. // @version 1.7.8.12
  5. // @description Enables select, right-click, copy and drag on pages that disable them. Enhanced Feature: Alt Key HyperLink Text Selection
  6. // @description:zh-TW 解除禁止復制、剪切、選擇文本、右鍵菜單的限制。破解鎖右鍵、文字複製、文字選取。增強功能:Alt鍵超連結文字選取。
  7. // @include /^https?\:\/\//
  8. // @grant none
  9. // @run-at document-start
  10. // @namespace https://greasyfork.org/users/371179
  11. // ==/UserScript==
  12. (function $$() {
  13. 'use strict';
  14. if (document == null || !document.documentElement) return window.requestAnimationFrame($$); // this is tampermonkey bug?? not sure
  15. //console.log('script at', location)
  16.  
  17. function $nil() {}
  18.  
  19. function isSupportAdvancedEventListener() {
  20. if ('_b1750' in $) return $._b1750
  21. var prop = 0;
  22. document.createAttribute('z').addEventListener('nil', $nil, {
  23. get passive() {
  24. prop++;
  25. },
  26. get once() {
  27. prop++;
  28. }
  29. });
  30. return ($._b1750 = prop == 2);
  31. }
  32.  
  33. function isSupportPassiveEventListener() {
  34. if ('_b1650' in $) return $._b1650
  35. var prop = 0;
  36. document.createAttribute('z').addEventListener('nil', $nil, {
  37. get passive() {
  38. prop++;
  39. }
  40. });
  41. return ($._b1650 = prop == 1);
  42. }
  43.  
  44. var getSelection = window.getSelection || Error()(),
  45. requestAnimationFrame = window.requestAnimationFrame || Error()(),
  46. getComputedStyle = window.getComputedStyle || Error()();
  47.  
  48. const $ = {
  49. utSelectionColorHack: 'msmtwejkzrqa',
  50. utTapHighlight: 'xfcklblvkjsj',
  51. utLpSelection: 'gykqyzwufxpz',
  52. utHoverBlock: 'meefgeibrtqx', //scc_emptyblock
  53. utDragging: 'nywjxajqlnwo',
  54. ksFuncReplacerNonFalse: '___dqzadwpujtct___',
  55. ksEventReturnValue: ' ___ndjfujndrlsx___',
  56. ksSetData: '___rgqclrdllmhr___',
  57.  
  58. eh_capture_passive: () => isSupportPassiveEventListener() ? ($._eh_capture_passive = ($._eh_capture_passive || {
  59. capture: true,
  60. passive: true
  61. })) : true,
  62.  
  63. mAlert_DOWN: function() {}, //dummy function in case alert replacement is not valid
  64. mAlert_UP: function() {}, //dummy function in case alert replacement is not valid
  65.  
  66. isAnySelection: function() {
  67. var sel = getSelection();
  68. return !sel ? null : (typeof sel.isCollapsed == 'boolean') ? !sel.isCollapsed : (sel.toString().length > 0);
  69. },
  70.  
  71. createCSSElement: function(cssStyle, container) {
  72. var css = document.createElement('style'); //slope: DOM throughout
  73. css.type = 'text/css';
  74. css.innerHTML = cssStyle;
  75. if (container) container.appendChild(css);
  76. return css;
  77. },
  78.  
  79. createFakeAlert: function(_alert) {
  80. if (typeof _alert != 'function') return null;
  81.  
  82. function alert(msg) {
  83. alert.__isDisabled__() ? console.log("alert msg disabled: ", msg) : _alert.apply(this, arguments);
  84. };
  85. alert.toString = () => "function alert() { [native code] }";
  86. return alert;
  87. },
  88.  
  89. createFuncReplacer: function(originalFunc, pName, resFX) {
  90. resFX = function(ev) {
  91. var res = originalFunc.apply(this, arguments);
  92. if (!this || this[pName] != resFX) return res; // if this is null or undefined, or this.onXXX is not this function
  93. if (res === false) return; // return undefined when "return false;"
  94. originalFunc[$.ksFuncReplacerNonFalse] = true;
  95. this[pName] = originalFunc; // restore original
  96. return res;
  97. }
  98. resFX.toString = () => originalFunc.toString();
  99. return resFX;
  100. },
  101.  
  102. listenerDisableAll: function(evt) {
  103. var elmNode = evt.target;
  104. while (elmNode && elmNode.nodeType > 0) { //i.e. HTMLDocument or HTMLElement
  105. var pName = 'on' + evt.type
  106. var f = elmNode[pName];
  107. if (typeof f == 'function' && f[$.ksFuncReplacerNonFalse] !== true) {
  108. var nf = $.createFuncReplacer(f, pName);
  109. nf[$.ksFuncReplacerNonFalse] = true;
  110. elmNode[pName] = nf;
  111. }
  112. elmNode = elmNode.parentNode;
  113. }
  114. },
  115.  
  116. onceCssHighlightSelection: () => {
  117. if (document.documentElement.hasAttribute($.utLpSelection)) return;
  118. $.onceCssHighlightSelection = null
  119. Promise.resolve().then(() => {
  120. var s = [...document.querySelectorAll('a,p,div,span,b,i,strong,li')].filter(elm => elm.childElementCount === 0); // randomly pick an element containing text only to avoid css style bug
  121. var elm = !s.length ? document.body : s[s.length >> 1];
  122. return elm
  123. }).then(elm => {
  124. var selectionStyle = getComputedStyle(elm, ':selection');
  125. if (/^rgba\(\d+,\s*\d+,\s*\d+,\s*0\)$/.test(selectionStyle.getPropertyValue('background-color'))) document.documentElement.setAttribute($.utSelectionColorHack, "");
  126. return elm;
  127. }).then(elm => {
  128. var elmStyle = getComputedStyle(elm)
  129. if (/^rgba\(\d+,\s*\d+,\s*\d+,\s*0\)$/.test(elmStyle.getPropertyValue('-webkit-tap-highlight-color'))) document.documentElement.setAttribute($.utTapHighlight, "");
  130. })
  131. },
  132.  
  133. isCurrentClipboardDataReplaced: function(clipboardData) {
  134. var items = clipboardData ? clipboardData.items : null;
  135. if (items && items.length > 0) {
  136. for (var i = 0, l = items.length; i < l; i++) {
  137. if (items[i].type == 'text/plain') return true;
  138. }
  139. }
  140. return false;
  141. },
  142.  
  143. replacementSetData: function(_setData, evt) {
  144. if (typeof _setData != 'function') return;
  145.  
  146. function setData() {
  147. var res = _setData.apply(this, arguments);
  148. try {
  149. if (evt.clipboardData === this && this.setData === setData && evt.cancelable && evt.defaultPrevented === false) {
  150. if ($.isCurrentClipboardDataReplaced(evt.clipboardData)) {
  151. evt.preventDefault();
  152. if (evt.defaultPrevented === true) {
  153. this.setData = _setData;
  154. delete this[$.ksSetData];
  155. }
  156. }
  157. }
  158. } catch (e) {}
  159. return res;
  160. }
  161. setData.toString = () => _setData.toString();
  162. evt.clipboardData.setData = setData;
  163. evt.clipboardData[$.ksSetData] = _setData;
  164. },
  165.  
  166.  
  167. enableSelectClickCopy: function() {
  168.  
  169. $.eyEvts = ['keydown', 'keyup', 'copy', 'contextmenu', 'select', 'selectstart', 'dragstart', 'beforecopy']; //slope: throughout
  170.  
  171. function isDeactivePreventDefault(evt) {
  172. if ($.bypass) return false;
  173. var j = $.eyEvts.indexOf(evt.type);
  174. switch (j) {
  175. case 6:
  176. if ($.enableDragging) return false;
  177. if (evt.target.hasAttribute('draggable')) {
  178. $.enableDragging = true;
  179. Promise.resolve().then(() => {
  180. evt.target.ownerDocument.documentElement.setAttribute($.utDragging, '')
  181. })
  182. return false;
  183. }
  184. //if(evt.target.hasAttribute('draggable')&&evt.target!=window.getSelection().anchorNode)return false;
  185. return true;
  186. case 3:
  187. if (evt.target instanceof Element && (evt.target.textContent || "").trim().length === 0) return false; //exclude elements like video
  188. return true;
  189. case -1:
  190. return false;
  191. case 0:
  192. case 1:
  193. return (evt.keyCode == 67 && (evt.ctrlKey || evt.metaKey) && !evt.altKey && !evt.shiftKey && $.isAnySelection() === true);
  194. case 2:
  195.  
  196. if (!('clipboardData' in evt && 'setData' in DataTransfer.prototype)) return true; // Event oncopy not supporting clipboardData
  197. // see the richtext hack in https://www.cleancss.com/css-beautify/
  198. // see https://developer.mozilla.org/zh-CN/docs/Web/API/Element/copy_event
  199. // see https://w3c.github.io/clipboard-apis/#widl-ClipboardEvent-clipboardData
  200.  
  201. if ($.isCurrentClipboardDataReplaced(evt.clipboardData) == false) { //no replacement data
  202. if (!evt.clipboardData[$.ksSetData] && evt.cancelable && evt.defaultPrevented === false) $.replacementSetData(evt.clipboardData.setData, evt);
  203. return true;
  204. }
  205. var trimedSelectionText = getSelection().toString().trim()
  206. if (trimedSelectionText) {
  207. //there is replacement data and the selection is not empty
  208. console.log("copy event - clipboardData replacement is allowed and the selection is not empty", trimedSelectionText)
  209. return false;
  210. } else {
  211. //there is replacement data and the selection is empty
  212. return false;
  213. }
  214. break; // for js formatting only
  215.  
  216. default:
  217. return true;
  218. }
  219. }
  220.  
  221. Event.prototype.preventDefault = (function(f) {
  222. function preventDefault() {
  223. if (!isDeactivePreventDefault(this)) f.apply(this);
  224. }
  225. preventDefault.toString = () => f.toString();
  226. return preventDefault;
  227. })(Event.prototype.preventDefault);
  228.  
  229. Object.defineProperty(Event.prototype, "returnValue", {
  230. get() {
  231. return $.ksEventReturnValue in this ? this[$.ksEventReturnValue] : true;
  232. },
  233. set(newValue) {
  234. if (!isDeactivePreventDefault(this) && newValue === false) this.preventDefault();
  235. this[$.ksEventReturnValue] = newValue;
  236. },
  237. enumerable: true,
  238. configurable: true
  239. });
  240.  
  241. for (var i = 2, eventsCount = $.eyEvts.length; i < eventsCount; i++) {
  242. document.addEventListener($.eyEvts[i], $.listenerDisableAll, true); // Capture Event; passive:false; expected occurrence COMPLETELY before Target Capture and Target Bubble
  243. }
  244.  
  245. var _alert = window.alert; //slope: temporary
  246. if (typeof _alert == 'function') {
  247. var _mAlert = $.createFakeAlert(_alert);
  248. if (_mAlert) {
  249. var clickBlockingTo = 0;
  250. _mAlert.__isDisabled__ = () => clickBlockingTo > +new Date;
  251. $.mAlert_DOWN = () => (clickBlockingTo = +new Date + 50);
  252. $.mAlert_UP = () => (clickBlockingTo = +new Date + 20);
  253. window.alert = _mAlert
  254. }
  255. }
  256.  
  257. },
  258.  
  259. lpCheckPointer: function(targetElm) {
  260. if (targetElm && targetElm.nodeType == 1 && targetElm.matches('*:hover')) {
  261. if (getComputedStyle(targetElm).getPropertyValue('cursor') == 'pointer' && targetElm.textContent) return true;
  262. }
  263. return false;
  264. },
  265.  
  266. lpFullCancel: function(evt, toPreventDefault) {
  267. $.bypass = true;
  268. !toPreventDefault || evt.preventDefault()
  269. evt.stopPropagation();
  270. evt.stopImmediatePropagation();
  271. $.bypass = false;
  272. },
  273.  
  274. lpMouseDown: function(evt) {
  275. $.lpMouseActive = 0;
  276. if (evt.altKey && !evt.ctrlKey && !evt.metaKey && !evt.shiftKey && evt.button === 0 && $.lpCheckPointer(evt.target)) {
  277. $.lpMouseActive = 1;
  278. $.lpFullCancel(evt, false);
  279. document.documentElement.setAttribute($.utLpSelection, '');
  280. }
  281. },
  282.  
  283. lpMouseUp: function(evt) {
  284. if ($.lpMouseActive == 1) {
  285. $.lpMouseActive = 2;
  286. document.documentElement.removeAttribute($.utLpSelection);
  287. $.lpFullCancel(evt, false);
  288. if ($.onceCssHighlightSelection) window.requestAnimationFrame($.onceCssHighlightSelection);
  289. }
  290. },
  291.  
  292. lpClick: function(evt) {
  293. if ($.lpMouseActive == 2) {
  294. $.lpFullCancel(evt, false);
  295. }
  296. },
  297.  
  298. lpEnable: function() { // this is an optional feature for modern browser
  299. // the built-in browser feature has already disabled the default event behavior, the coding is just to ensure no "tailor-made behavior" occuring.
  300. document.addEventListener('mousedown', $.lpMouseDown, {
  301. capture: true,
  302. passive: true
  303. })
  304. document.addEventListener('mouseup', $.lpMouseUp, {
  305. capture: true,
  306. passive: true
  307. })
  308. document.addEventListener('click', $.lpClick, {
  309. capture: true,
  310. passive: true
  311. })
  312. },
  313.  
  314. mainEnableScript: () => {
  315. var cssStyleOnReady = `
  316. html:not([${$.utDragging}]), html:not([${$.utDragging}]) *,
  317. html:not([${$.utDragging}]) *::before, html:not([${$.utDragging}]) *::after,
  318. html:not([${$.utDragging}]) *:hover, html:not([${$.utDragging}]) *:link, html:not([${$.utDragging}]) *:visited, html:not([${$.utDragging}]) *:active,
  319. html:not([${$.utDragging}]) *[style], html:not([${$.utDragging}]) *[class]{
  320. -khtml-user-select: auto !important; -moz-user-select: auto !important; -ms-user-select: auto !important;
  321. -webkit-touch-callout: default !important; -webkit-user-select: auto !important; user-select: auto !important;
  322. }
  323. *:hover>img[src]{pointer-events:auto !important;}
  324.  
  325. [${$.utSelectionColorHack}] :not(input):not(textarea)::selection{ background-color: Highlight !important; color: HighlightText !important;}
  326. [${$.utSelectionColorHack}] :not(input):not(textarea)::-moz-selection{ background-color: Highlight !important; color: HighlightText !important;}
  327. [${$.utTapHighlight}] *{ -webkit-tap-highlight-color: rgba(0, 0, 0, 0.18) !important;}
  328.  
  329. html[${$.utLpSelection}] *:hover, html[${$.utLpSelection}] *:hover * { cursor:text !important;}
  330. html[${$.utLpSelection}] :not(input):not(textarea)::selection {background-color: rgba(255, 156, 179,0.5) !important;}
  331. html[${$.utLpSelection}] :not(input):not(textarea)::-moz-selection {background-color: rgba(255, 156, 179,0.5) !important;}
  332.  
  333. [${$.utHoverBlock}="2"]{pointer-events:none !important;user-select:none !important;}
  334. img[${$.utHoverBlock}="4"]{
  335. display:none !important;
  336. }
  337. :hover[${$.utHoverBlock}="7"]{
  338. padding:0 !important;
  339. }
  340. :hover[${$.utHoverBlock}="7"]>img[${$.utHoverBlock}="4"]:first-child{
  341. display:inline-block !important;
  342. opacity: 0 !important;
  343. padding: 0 !important;
  344. margin: 0 !important;
  345. position: relative !important;
  346. z-index:1 !important;
  347. width: 100% !important;
  348. height: 100% !important;
  349. left: 0 !important;
  350. top: 0 !important;
  351. outline: 0 !important;
  352. border: 0 !important;
  353. box-sizing: border-box !important;
  354. transform: initial !important;
  355. pointer-events:auto !important; user-select:none !important;cursor:inherit !important;}
  356.  
  357. `.trim();
  358.  
  359. $.enableSelectClickCopy()
  360. $.createCSSElement(cssStyleOnReady, document.documentElement);
  361.  
  362. },
  363.  
  364. mainEvents: (listenerPress, listenerRelease) => {
  365. document.addEventListener("mousedown", listenerPress, true); // Capture Event; (desktop)
  366. document.addEventListener("contextmenu", listenerPress, true); // Capture Event; (desktop&mobile)
  367. document.addEventListener("mouseup", listenerRelease, false); // Bubble Event;
  368. },
  369.  
  370. disableHoverBlock: () => {
  371.  
  372. var nMap = new WeakMap()
  373.  
  374. function elmParam(elm) {
  375.  
  376. var mElm = nMap.get(elm);
  377. if (!mElm) nMap.set(elm, mElm = {});
  378. return mElm;
  379. }
  380.  
  381. function overlapArea(rect1, rect2) {
  382.  
  383. let l1 = {
  384. x: rect1.left,
  385. y: rect1.top
  386. }
  387.  
  388. let r1 = {
  389. x: rect1.right,
  390. y: rect1.bottom
  391. }
  392. let l2 = {
  393. x: rect2.left,
  394. y: rect2.top
  395. }
  396.  
  397. let r2 = {
  398. x: rect2.right,
  399. y: rect2.bottom
  400. }
  401.  
  402. // Area of 1st Rectangle
  403. let area1 = Math.abs(l1.x - r1.x) * Math.abs(l1.y - r1.y);
  404.  
  405. // Area of 2nd Rectangle
  406. let area2 = Math.abs(l2.x - r2.x) * Math.abs(l2.y - r2.y);
  407.  
  408. // Length of intersecting part i.e
  409. // start from max(l1.x, l2.x) of
  410. // x-coordinate and end at min(r1.x,
  411. // r2.x) x-coordinate by subtracting
  412. // start from end we get required
  413. // lengths
  414. let x_dist = Math.min(r1.x, r2.x) - Math.max(l1.x, l2.x);
  415. let y_dist = (Math.min(r1.y, r2.y) - Math.max(l1.y, l2.y));
  416. let areaI = 0;
  417. if (x_dist > 0 && y_dist > 0) {
  418. areaI = x_dist * y_dist;
  419. }
  420.  
  421. return {
  422. area1,
  423. area2,
  424. areaI
  425. };
  426.  
  427.  
  428. }
  429.  
  430. function redirectEvent(event, toElement) {
  431.  
  432. toElement.dispatchEvent(new event.constructor(event.type, event));
  433. if (event.type != 'wheel') event.preventDefault();
  434. event.stopPropagation();
  435. }
  436.  
  437. const floatingBlockHover = new WeakMap();
  438.  
  439. document.addEventListener('mouseenter', function(evt) {
  440.  
  441. Promise.resolve()
  442. .then(() => {
  443.  
  444. if (evt && evt.target && evt.target.parentNode) {} else {
  445. return;
  446. }
  447.  
  448. if (floatingBlockHover.has(evt.target)) return;
  449.  
  450. function setNULL() {
  451. floatingBlockHover.set(evt.target, 1)
  452. }
  453.  
  454. setNULL();
  455.  
  456. return 1;
  457.  
  458. }).then((ayRes) => {
  459.  
  460. if (!ayRes) return;
  461.  
  462. if (evt.target.nodeType != 1) return;
  463. if ("|SVG|IMG|HTML|BODY|VIDEO|AUDIO|BR|HEAD|NOSCRIPT|SCRIPT|STYLE|TEXTAREA|AREA|INPUT|FORM|BUTTON|".indexOf(`|${evt.target.nodeName}|`) >= 0) return;
  464.  
  465.  
  466.  
  467. const targetArea = evt.target.clientWidth * evt.target.clientHeight
  468.  
  469. if (targetArea > 0) {} else {
  470. return;
  471. }
  472.  
  473. const targetCSS = getComputedStyle(evt.target)
  474. const targetBgImage = targetCSS.getPropertyValue('background-image');
  475. let exec1 = null
  476.  
  477. if (targetBgImage != 'none' && (exec1 = /^\s*url\s*\("?([^"\)]+\b(\.gif|\.png|\.jpeg|\.jpg|\.webp)\b[^"\)]*)"?\)\s*$/i.exec(targetBgImage))) {
  478. if ((evt.target.textContent || "").trim().length > 0) return;
  479. const url = exec1[1];
  480. return url
  481.  
  482. // console.log(targetBgImage,[...exec1])
  483. }
  484.  
  485.  
  486.  
  487. if (targetCSS.getPropertyValue('position') == 'absolute' && +targetCSS.getPropertyValue('z-index') > 0) {} else {
  488. return;
  489. }
  490. if ((evt.target.textContent || "").trim().length > 0) return;
  491.  
  492. let possibleResults = [];
  493.  
  494. for (const imgElm of document.querySelectorAll('img[src]')) {
  495. const param = elmParam(imgElm)
  496. if (!param.area) {
  497. const area = imgElm.clientWidth * imgElm.clientHeight
  498. if (area > 0) param.area = area;
  499. }
  500. if (param.area > 0) {
  501. if (targetArea > param.area * 0.9) possibleResults.push(imgElm)
  502. }
  503. }
  504.  
  505. let i = 0;
  506. let j = 0;
  507. for (const imgElm of possibleResults) {
  508.  
  509. const cmpVal = evt.target.compareDocumentPosition(imgElm)
  510.  
  511. /*
  512.  
  513.  
  514. 1: The two nodes do not belong to the same document.
  515. 2: p1 is positioned after p2.
  516. 4: p1 is positioned before p2.
  517. 8: p1 is positioned inside p2.
  518. 16: p2 is positioned inside p1.
  519. 32: The two nodes has no relationship, or they are two attributes on the same element.
  520.  
  521. */
  522.  
  523. if (cmpVal & 8 || cmpVal & 16) return;
  524. if (cmpVal & 2) j++; // I<p
  525. else if (cmpVal & 4) break; // I>p
  526.  
  527.  
  528. i++;
  529.  
  530. }
  531.  
  532. // before: j-1 after: j
  533.  
  534. let indexBefore = j - 1;
  535. let indexAfter = j;
  536. if (indexBefore < 0) indexBefore = 0;
  537. if (indexAfter > possibleResults.length - 1) indexAfter = possibleResults.length - 1;
  538.  
  539. // setTimeout(function(){
  540. for (let i = indexBefore; i <= indexAfter; i++) {
  541. const s = possibleResults[i];
  542. const {
  543. area1,
  544. area2,
  545. areaI
  546. } = overlapArea(evt.target.getBoundingClientRect(), s.getBoundingClientRect())
  547. const criteria = area1 * 0.7
  548. if (areaI > 0.9 * area2) {
  549.  
  550.  
  551. return s.getAttribute('src')
  552.  
  553.  
  554. }
  555. }
  556. // },1000);
  557.  
  558. }).then((sUrl) => {
  559.  
  560. if (typeof sUrl != 'string') return;
  561.  
  562.  
  563. // console.log(313, evt.target, s)
  564. let nImg = document.createElement('img');
  565. nImg.onerror = function() {
  566. if (this.parentNode != null) this.parentNode.removeChild(this)
  567. }
  568. nImg.setAttribute($.utHoverBlock, '4');
  569. evt.target.insertBefore(nImg, evt.target.firstChild);
  570. nImg.setAttribute('src', sUrl);
  571. evt.target.setAttribute($.utHoverBlock, '7');
  572. !(function(hElm) {
  573. const handle = function(event) {
  574. if (event.button != 2) redirectEvent(event, hElm)
  575. }
  576. nImg.addEventListener('click', handle, true);
  577. nImg.addEventListener('mousedown', handle, true);
  578. nImg.addEventListener('mouseup', handle, true);
  579. nImg.addEventListener('mousemove', handle, true);
  580. nImg.addEventListener('mouseover', handle, true);
  581. nImg.addEventListener('mouseout', handle, true);
  582. nImg.addEventListener('mouseenter', handle, true);
  583. nImg.addEventListener('mouseleave', handle, true);
  584. nImg.addEventListener('wheel', handle, $.eh_capture_passive());
  585. })(evt.target)
  586.  
  587.  
  588.  
  589. })
  590.  
  591. }, $.eh_capture_passive())
  592.  
  593. }
  594.  
  595. }
  596.  
  597. $.mainEnableScript();
  598.  
  599. if (isSupportAdvancedEventListener()) $.lpEnable(); // top capture event for alt-click
  600.  
  601. $.mainEvents(
  602. function(evt) {
  603. if ($.onceCssHighlightSelection) window.requestAnimationFrame($.onceCssHighlightSelection);
  604. if (evt.button == 2 || evt.type == "contextmenu") $.mAlert_DOWN();
  605. },
  606. function(evt) {
  607. if (evt.button == 2) $.mAlert_UP();
  608. if ($.enableDragging) {
  609. $.enableDragging = false;
  610. Promise.resolve().then(() => {
  611. evt.target.ownerDocument.documentElement.removeAttribute($.utDragging)
  612. })
  613. }
  614. }
  615. );
  616.  
  617. $.disableHoverBlock();
  618.  
  619. console.log('userscript running - To Re-Enable Selection & Copying');
  620.  
  621.  
  622.  
  623.  
  624. })();