Skip to content

ericandrewlewis/rich-link-for-webpage-bookmarklet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Rich Link for Webpage Bookmarklet

This bookmarklet copies a link to the current webpage you're on for pasting into a document.

Preview

ezgif com-gif-maker

Installation

Create a bookmark in your browser.

Copy and paste the following into the bookmark's "URL" field:

javascript:(function () {  let pageTitle = document.title;  pageTitle = pageTitle.replace(' - Google Docs', '');  const url = window.location.href;  const clipboardContentHtml = `<a href="${url}">${pageTitle}</a>`;  function listener(e) {;    e.clipboardData.setData("text/html", clipboardContentHtml);    e.clipboardData.setData("text/plain", url);    e.preventDefault();  } document.addEventListener("copy", listener);  document.execCommand("copy");  document.removeEventListener("copy", listener);})();

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published