Greasy Fork is available in English.

Stack Overflow Code Copy

Adds a small copy button to the top right corner of all code blocks on Stack Overflow making the copying process a breeze

Από την 01/06/2024. Δείτε την τελευταία έκδοση.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

Δημιουργός
slyfox1186
Βαθμολογίες
0 0 0
Έκδοση
1.1
Δημιουργήθηκε την
14/04/2024
Ενημερώθηκε την
01/06/2024
Μέγεθος
2 KB
Άδεια
MIT
Εφαρμόζεται σε

Stack Overflow Code Copy Button

Introduction

The "Stack Overflow Code Copy" Tampermonkey script enhances the Stack Overflow experience by adding a convenient "Copy" button to each code block on question pages. This functionality allows users to quickly and easily copy code snippets without manually selecting the content.

Features

Copy Button

  • Easy Access: A "Copy" button is positioned at the top-right corner of each code block.
  • Instant Copy: Clicking the button instantly copies the code to the clipboard.

Seamless Integration

  • Unobtrusive Design: The button fits naturally within the Stack Overflow interface.
  • Efficient Performance: The script runs without impacting page load times or performance.

Why Use This Script?

Convenience

Eliminates the need to manually select code, which can be cumbersome and error-prone, especially with longer snippets.

Time-Saving

Reduces the steps needed to copy code, saving time for users who need to quickly gather and apply solutions.

Accuracy

Ensures the entire code block is copied exactly as is, without missing parts or adding extra whitespace or characters.

How It Works

When visiting a question page on Stack Overflow, the script:

  1. Scans for code blocks within <pre> tags.
  2. Creates a "Copy" button for each code block.
  3. Positions the button in the top-right corner of the code block.
  4. Sets up the button to copy the code block content to the clipboard when clicked.

Installation

To install the script:

  1. Install the Tampermonkey extension for your browser.
  2. Create a new script in Tampermonkey and paste the content of this script into the editor.
  3. Save the script and visit any question page on Stack Overflow to see it in action.

Enhance your Stack Overflow experience by focusing on solving problems, not on copying code.