Skip to content

Instantly share code, notes, and snippets.

@tomoyk
Last active March 6, 2024 10:17
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 tomoyk/673926c1b7d4203355a4b1ca2a98b0a7 to your computer and use it in GitHub Desktop.
Save tomoyk/673926c1b7d4203355a4b1ca2a98b0a7 to your computer and use it in GitHub Desktop.

タイトルとURLをMarkdown形式でコピー

v1

javascript:a=prompt('mdlink','['+document.title+']('+document.location.href+')');a.preventDefault;

v2

javascript:(()=>{const e=`[${document.title}](${location.href})`,t=document.createElement("textarea");t.textContent=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),console.log(`Copyed this website title and URL: ${e}`)})();

タイトルとURLをスペース区切りでコピー

v1

javascript:prompt('Title + URL',document.title+' '+window.location.href);

v2

javascript:(()=>{const e=`${document.title} ${location.href}`,t=document.createElement("textarea");t.textContent=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),console.log(`Copyed this website title and URL: ${e}`)})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment