Greasy Fork - Copy Code Button

Adds a split Copier button on both the script Info page (next to the install button) and the Code page (above the code block). Copy to clipboard or download as .js / .txt / .md. Includes Ctrl+Shift+C shortcut and live line/char stats.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Tekijä
achma
Päivittäiset asennukset
0
Asennuskerrat
7
Arvostelut
0 0 0
Versio
3.0
Luotu
8.3.2026
Päivitetty
8.3.2026
Size
23 kt
Lisenssi
MIT
Käytössä

Greasy Fork — Copy Code Button

A lightweight userscript that adds a split Copier ∨ button to Greasy Fork — on both the script Info page (right next to the install button) and the Code page (above the code block). One click copies the full source; the arrow opens a download menu.

No more selecting thousands of lines manually.


✨ Features

  • Works on two pages — Info page (/scripts/*) and Code page (/scripts/*/code)
  • One-click copy — instantly copies the full script source to your clipboard
  • Smart fetching — on the Info page, the source is silently fetched from the install URL in the background; no need to visit the Code tab first
  • Download menu — click the arrow to download the script as .js, .txt, or .md
  • Loading state — shows a spinner while fetching on the Info page, with clear success/error feedback
  • Code stats — displays live line count and character count on the Code page
  • Keyboard shortcutCtrl+Shift+C (or ⌘+Shift+C on Mac) works on both pages
  • Dark mode support — adapts to Greasy Fork's dark theme automatically

📸 Where the button appears

On the Info page — next to the install button:

[ Install this script ]  [?]  [ Copier ∨ ]

On the Code page — above the code block:

[ ☑ Wrap lines ]  [ Copier ∨ ]   4,823 lines · 128,450 chars   Ctrl+Shift+C
────────────────────────────────────────────────────────────────────────────
  1  // ==UserScript==
  2  // @name  My Script
  ...

📥 Download options (∨ arrow)

Format Description
.js Raw JavaScript source file, ready to install or edit
.txt Plain text copy of the source
.md Source wrapped in a fenced javascript Markdown code block

The file is automatically named after the script's title.


🚀 How to Use

  1. Navigate to any script page on Greasy Fork, e.g.:
  2. Click Copier to copy to clipboard, or click to download
  3. Paste wherever you need it (Ctrl+V)

Or skip the mouse — press Ctrl+Shift+C anywhere on the page.


⚙️ Permissions

This script requests GM_xmlhttpRequest with @connect update.greasyfork.org.

This permission is used only to fetch the raw .user.js source when you click Copier on the Info page (where the code is not in the DOM). No data is collected or sent anywhere else.


🤝 Contributing

Open source — contributions, forks, and suggestions are very welcome!

  • Found a bug or have an idea? Leave a comment in the Feedback tab
  • Want to improve it? Fork and post a derivative — or open a discussion

📝 Changelog

v3.0 — Dual-page support + smart fetch

  • New: Button now appears on the Info page (/scripts/*), placed immediately to the right of the ? install help link
  • New: On the Info page, clicking Copier silently fetches the raw source via GM_xmlhttpRequest from the install URL — no need to navigate to the Code tab
  • New: Loading spinner state (Fetching…) shown while source is being retrieved
  • New: Download items are disabled (greyed out) during an active fetch to prevent duplicate requests
  • Improved: Both pages now share the exact same button component — same styles, same dropdown, same keyboard shortcut
  • Improved: @grant GM_xmlhttpRequest + @connect update.greasyfork.org added to header for cross-origin fetch support

v2.0 — Split button + download menu

  • New: Redesigned as a split button: Copier on the left, chevron on the right
  • New: Download dropdown with three format options: .js, .txt, .md
  • New: .md format wraps the source in a fenced JavaScript code block
  • New: Files are auto-named from the script's page title
  • New: Chevron rotates 180° when dropdown is open; closes on Escape or outside click
  • Removed: Sleazy Fork support

v1.0 — Initial release

  • Copy button injected above the code block on Code pages
  • Success / error visual feedback states
  • Live line + character count display
  • Ctrl+Shift+C / ⌘+Shift+C keyboard shortcut
  • Dark mode support