Item logo image for Tab Link Copier

Tab Link Copier

3.5(

17 ratings

)
ExtensionWorkflow & Planning738 users

5 support issues

For additional help, check out the developer's support site.

  • All
  • Questions
  • Suggestions
  • Problems

Jeff Baker

Sep 6, 2021

Solution to small font size

I tried many things to try and stop the copied link from getting the default style from Chrome with a small fontSize and a fontFamily set. Nothing worked until I found this function:

function copyToClip(str) {
function listener(e) {
e.clipboardData.setData("text/html", str);
e.clipboardData.setData("text/plain", str);
e.preventDefault();
}
document.addEventListener("copy", listener);
document.execCommand("copy");
document.removeEventListener("copy", listener);
}

You can use it like this in your extension code:
var link = '<a href="' + url + '">' + title + '</a>';
copyToClip(link);

With this code it copies the rich text link to the clipboard without any style attributes. If you change your code to the above then I think it will be a much more enjoyable experience for your users. Thanks again for the extension!

James Murdza

Aug 12, 2017

Uh-oh

Stopped working, only pastes "undefined".

A Chrome Web Store user

Aug 1, 2017

He's not working.


It's been two weeks since it stopped working.

r w

Jul 17, 2017

url is not copied

Only title is copied

David Rees

Dec 18, 2015

Copied in small font

It seems to copy the link in a small font size. Could it possibly copy it without any font size (so when pasting the destination documents font size is used)? Thanks!

Google apps