A Universal Script to Re-Enable the Selection and Copying

Enables select, right-click, copy and drag on pages that disable them. Additional Feature: Long Press Text Selection

As of 2021-06-14. See the latest version.

Author
𝖢𝖸 𝖥𝗎𝗇𝗀
Ratings
0 0 0
Version
1.6.2
Created
2021-06-06
Updated
2021-06-14
License
N/A
Applies to

Description:
This is a most powerful script to let you copy and select without affecting the normal features of each site.

1) disables the ".preventDefault()" function for 'copy', 'contextmenu', 'select', 'selectstart', 'dragstart', 'beforecopy' events
2) disables the "return false" in HTML attributes 'oncopy', 'oncontextmenu', 'onselect', 'onselectstart', 'ondragstart', 'onbeforecopy'
3) disables the "returnValue" in javascript coding for 'copy', 'contextmenu', 'select', 'selectstart', 'dragstart', 'beforecopy' events
4) re-enable "pointer-events" for images
5) de-block "alert()" for mouse right click
6) css hack to re-enable the selection coloring if transparent coloring is applied
7) disables the ".preventDefault()" function and "returnValue=false" for 'Ctrl-C' in 'mousedown' & 'mouseup' events if there is text selection
8) allowing the clipboard data replacement in 'copy' events. (in other words, the website can also disable your copying...)

New Feature:
1) "Long Press Text Selection" - You can now copy the link / button text using left-click (press for 0.3s); the cursor will change from "pointer" to "text", and the selection shall be in pink color.


Similar features to the following:
> Absolute Enable Right Click & Copy - Force Enable Right Click & Copy & Highlight
> Allow Copy and Context Menu Continued - Disable (remove) copy text protection and allow copy for all sites
> 通殺大部分網站,可以解除禁止復制、剪切、選擇文本、右鍵菜單的限制。

Sample URLs for your testing:
https://jsfiddle.net/xLcv3o9z/1/ (old school style - hard coding "return false;" & "returnValue=false")
https://amigurumi.today/large-ami-cat-crochet-pattern/
https://www.peekme.cc/post/1220893
https://read.qidian.com/chapter/ORlSeSgZ6E_MQzCecGvf7A2/fpUeEW2LD3fwrjbX3WA1AA2
http://www.bimiacg.net/bangumi/bi/3486/
https://www.uta-net.com/
https://boke112.com/post/2281.html (https://jsfiddle.net/dgj5es6m/) (this site uses special hacks like ":not(input):not(textarea)::selection" and keyboard ctrl-C)
https://www.uemeds.cn/ (for testing "long press text selection")

* known issues:
* this script is intentionally not to disable "return false" in keydown & keyup (Ctrl-C) to avoid performance issue; you should still be able to copy the text using right click.
* "preventDefault()", "returnValue=false", "return false" in mousedown would not be disabled (due to avoid conflict to the normal features)
* not working for `<input Value="test" onSelect="blur();">`