Copy Selected Links as Markdown

Copy selected link(s) on any page as Markdown: [text](url).

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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.

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

Δημιουργός
Pipecraft
Ημερήσιες εγκαταστάσεις
0
Σύνολο εγκαταστάσεων
3
Βαθμολογίες
0 0 0
Έκδοση
0.1.3
Δημιουργήθηκε την
04/12/2025
Ενημερώθηκε την
16/12/2025
Μέγεθος
5 KB
Άδεια
MIT
Εφαρμόζεται σε
Όλοι οι ιστοχώροι

Copy Selected Links as Markdown

Copy selected link(s) on any page to the clipboard as Markdown in the form [text](url). Supports single or multiple anchors inside selection, URL text detection, and page fallback. Includes a keyboard shortcut and a menu command.

中文版

Features

  • Copies selected link(s) as Markdown [text](url)
  • Single or multiple anchors; for multiple links outputs a Markdown bullet list
  • Detects URL in selected text when no anchor is present
  • Fallback to [document.title](location.href) when nothing is selected
  • Keyboard shortcut: Cmd/Ctrl + Shift + M
  • Menu command via GM_registerMenuCommand

Supported Sites

  • All sites: *://*/*

Installation

  1. Install a user script manager:
  2. Install the script:

Usage

  • Select link(s) or text on the page
  • Trigger one of the following:
    • Press Cmd/Ctrl + Shift + M
    • Use the menu command “复制选中链接为 Markdown”
  • Clipboard will contain Markdown; multiple links produce a Markdown bullet list

Technical Details

  • Finds anchors that intersect the current selection range and parent anchor when cursor is inside a link
  • Builds absolute URLs via new URL(anchor.href, location.origin)
  • Uses Clipboard API with document.execCommand('copy') fallback

Compatibility

Works on modern browsers with Tampermonkey/Violentmonkey.

Changelog

v0.1.0

  • Initial release: selection parsing, multi‑link output, shortcut and menu

More Useful Scripts

License

MIT License — see the repository LICENSE file.

Contributing

Issues and pull requests are welcome!

Related Links