Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mh61503891/52b76398b4530223ec4c83534f2f63b4 to your computer and use it in GitHub Desktop.
Save mh61503891/52b76398b4530223ec4c83534f2f63b4 to your computer and use it in GitHub Desktop.
Copy Title and URI as Scrapbox's format to Clipboard - */*
// ==UserScript==
// @name Copy Title and URI as Scrapbox's format to Clipboard
// @namespace https://msyk.hgsn.info/
// @noframes true
// @match *://*/*
// @grant GM_registerMenuCommand
// @grant GM_setClipboard
// @version 1.1
// @author Masayuki Higashino
// ==/UserScript==
function copy_title_and_uri_as_scrapboxs_format_to_clipboard(){
const title = document.title;
const uri = document.location.href;
const link = `[${title} ${uri}]`;
GM_setClipboard(link, 'text/plain')
}
GM_registerMenuCommand("Copy Title and URI as Scrapbox's format to Clipboard", copy_title_and_uri_as_scrapboxs_format_to_clipboard);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment