Selection and Copying Restorer (Universal)

𝖢𝖸 𝖥𝗎𝗇𝗀
2021-06-06T09:01:28Z

Unlock right-click, remove restrictions on copy, cut, select text, right-click menu, text copying, text selection, image right-click, and enhance functionality: Alt key hyperlink text selection.

Remove web limits; Allow Copy

Please make sure you install the script from greasyfork.org, not fake sites.

請確保您從greasyfork.org安裝腳本，而不是假網站。

greasyfork.orgからスクリプトをインストールしてください、偽のサイトからではありません。

Minimum Browser Versions:

Recommended Browser Versions:

Description:

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

Some China sites are deliberately designed to block the copying feature, like Badiu Wenku. This script is not that powerful to deblock such anti-feature. You might consider to try this script to get the site content.

Google Map Photos are using div background image css and canvas painting. Both of them are not supported in this userscript. You can try other userscript to download the images, such as Image Downloader

This is primarily for Texts and Images, not Videos and Audios.

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

if a non-empty string with text/plain is set.

original selection text will be shown in console.log(...) if it is also a non-empty string

Extra Feature: （額外功能:）

1. Enhanced build-in Alt Text Selection [inactive by default, recommended] - You can now copy the link / button text using Alt-click; the cursor will change from "pointer" to "text", and the selection shall be in pink color.
（增強內置Alt文字選取 - 針對超連結及按鈕文字，按Alt+Click後，鼠標會由"pointer"變成了"text"，並且選取區變成粉紅色。）

The mousedown event will become unpreventable. (see Sample Link)

2. Hover on Image [inactive by default] - Image Copying: deblock the hover element above the image element, clickable background image

3. Repetitive AuxClick Prevention [inactive by default, recommended] - Omit the repeated aux click event

4. Absolute Mode [inactive by default, switch on when necessary] - Bypass all event handling to contextmenu, copy, cut, paste, mouseup, mousedown, keyup, keydown, drag, dragstart, select, and selectstart (inspired by this script)

Similar features to the following:

Absolute Enable Right Click & Copy: Force Enable Right Click & Copy & Highlight

Allow Copy and Context Menu Continued: Allow Copy and Context Menu Continued - Disable (remove) copy text protection and allow copy for all sites

网页限制解除(改) / Remove web limits(modified) : 通殺大部分網站，可以解除禁止復制、剪切、選擇文本、右鍵菜單的限制。

Sample URLs for your testing:

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 (refer to jsFiddle#dgj5es6m)

https://www.uemeds.cn/ (enhanced feature - force enable Alt text selection)

https://www.flickr.com/photos/peste76/51260328730/in/explore-2021-06-20/ (right click on flickr image) *Hover on Image

https://votetw.com/wiki/%E6%9E%97%E6%99%BA%E5%A0%85 (alt text selection) *Enhanced build-in Alt Text Selection

Newspaper Website: https://www.hk01.com/%E6%95%B8%E7%A2%BC%E7%94%9F%E6%B4%BB/773214/

https://anime01kingdom.com/other/75152/

https://sinarbaraasia.com

https://pabrikarang.com/term-of-payment/ (Enhanced build-in Alt Text Selection)

Allow Copying:

https://www.cleancss.com/css-beautify/ (refer to jsFiddle#7agxytLp)

https://leetcode.cn/problems/implement-queue-using-stacks/ (copy code in editor)

Testing:

hard coding "return false;" & "returnValue=false": https://jsfiddle.net/xLcv3o9z/1/

":not(input):not(textarea)::selection" and keyboard ctrl-C: https://jsfiddle.net/dgj5es6m/

Link Selection: https://jsfiddle.net/f68ux7ob/

clipboardData Replacement in 'copy' event: https://jsfiddle.net/7agxytLp/ (refer to MDN Web Docs(zh-CN) 'copy' event) [To be fixed]

Remarks:

It is the intention that keyup, keydown, and blur events are kept at its own performance and functionality

You shall use "Right-Click-Copy" to copy the text for the following situtations:

1. "return false" is set in onkeydown &/or onkeyup (Ctrl-C)

2. Copy Text is replaced by the text you don't want when you press Ctrl-C (copy event)

You shall use "Alt-Click" to select the text for the following situtations:

1. mousedown is disabled

2. mouseup/click is linked with the change of location.href

Not working for