CopyAnything

Allows highlighting and copying text on websites where it might be disabled by overriding CSS and removing common disabling attributes.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği yüklemek için Tampermonkey gibi bir uzantı yüklemeniz gerekir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

Bu stili yüklemek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için Stylus gibi bir uzantı kurmanız gerekir.

Bu stili yükleyebilmek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı kurmanız gerekir.

Bu stili yükleyebilmek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

(Zateb bir user-style yöneticim var, yükleyeyim!)

Yazar
AMEND09
Günlük kurulumlar
0
Toplam kurulumlar
24
Değerlendirmeler
0 0 0
Versiyon
1.0
Oluşturulma
19.06.2025
Güncellenme
19.06.2025
Boyut
4,58 KB
Lisans
MIT
Geçerli
Tüm siteler

README: CopyAnything Greasemonkey Script

CopyAnything

This is a user script designed for Greasemonkey, Tampermonkey, and similar browser extensions. Its purpose is to overcome common restrictions imposed by websites that prevent users from highlighting, selecting, or copying text.

How It Works

The script employs a multi-pronged approach to ensure text selection and copying are enabled:


  1. CSS Override: It injects CSS rules with !important declarations that force all elements on the webpage to have user-select: text. This overrides any styles set by the website that might try to disable text selection (e.g., user-select: none). It includes vendor prefixes (-webkit-, -moz-, -ms-) for broader browser compatibility.

  2. Attribute Removal: Many websites use JavaScript event handlers attached directly to HTML elements to prevent interactions. This script identifies and removes common attributes like:
    • onselectstart: Prevents text selection from starting.
    • ondragstart: Prevents elements from being dragged, which can sometimes interfere with text selection.
    • oncontextmenu: Prevents the right-click context menu from appearing, which often contains the "Copy" option.

  3. Dynamic Content Handling (MutationObserver): Modern websites frequently load content dynamically after the initial page load. A simple one-time fix isn't enough for such sites. This script uses a MutationObserver to continuously monitor the webpage for changes. If new elements are added to the DOM or existing elements have their attributes modified, the script automatically applies the CSS overrides and removes disabling attributes to the new or changed content in real-time.

Key Features

  • Enables Text Selection: Allows you to highlight and select text on pages where it was previously disabled.
  • Restores Copy Functionality: By enabling selection and context menus, it facilitates copying text.
  • Handles Dynamic Content: Works effectively on single-page applications and sites that load content after the initial page render.
  • Lightweight: Designed to be efficient with minimal performance impact.

Installation

To use this script, you'll need a user script manager extension installed in your web browser. Popular options include:

  • Tampermonkey (Recommended for Chrome, Brave, Edge, Opera, Safari, Firefox)
  • Greasemonkey (For Firefox)

Steps:

  1. Install the Extension: Download and install either Tampermonkey or Greasemonkey from your browser's official extension store.
  2. Create a New Script: Once installed, click on the extension icon in your browser's toolbar and choose "Create a new script" (Tampermonkey) or "New User Script" (Greasemonkey).
  3. Paste the Code: A new editor tab will open. Delete any pre-existing code in this tab, then copy the entire content of the greasemonkey-text-enabler.js script and paste it into the editor.
  4. Save: Save the script (usually via File > Save or Ctrl+S/Cmd+S).
  5. Refresh Page: Navigate to the desired webpage and refresh it. The script should now be active.

Script made by Aditya Mendiratta