Last active
March 12, 2020 00:27
-
-
Save mh61503891/52b76398b4530223ec4c83534f2f63b4 to your computer and use it in GitHub Desktop.
Copy Title and URI as Scrapbox's format to Clipboard - */*
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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