Giter Site home page Giter Site logo

dhruvtv / copylinkaddress Goto Github PK

View Code? Open in Web Editor NEW
46.0 6.0 9.0 564 KB

Chrome extension to copy link address using keyboard.

Home Page: https://chrome.google.com/webstore/detail/copy-link-address/kdejdkdjdoabfihpcjmgjebcpfbhepmh

JavaScript 100.00%

copylinkaddress's Introduction

Use Chrome? Copy link address without right-clicking! Just use your standard keyboard shortcut!

If you need to copy link addresses more than once, you know how annoying it is. You need to right-click, find the "Copy Link Address" menu item, and click it.

This extension makes your life easy. Just point to your link and hit your standard keyboard shortcut (Ctrl-C, or Cmd-C for Mac) and you're done!

Download it at the Chrome Web Store

To try the latest dev version of the extension,

  1. Download the source (hit the 'ZIP' button you see at the top of the page) and extract to a directory
  2. In Chrome, launch chrome://extensions
  3. Enable Developer Mode
  4. Click 'Load Unpacked Extensions' and point to the above directory.
  5. Start using it!

Known Issues:

  1. Hovering over a link will make focused input lose focus (temporarily - focus restored when you move out of link).
  2. When the cursor is still in the URL box, hyperlink is not copied.

copylinkaddress's People

Contributors

dhruvtv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

copylinkaddress's Issues

Doesn't copy link if link is applied to image

Example:
<a href="http://somesite.com/someplace.htm"><img href="http://img.url/someimg.gif"></a>

When hovering over the above on a page and doing ctrl-c, nothing is copied, it would be great if the link would be extracted from these as well.

Copy Link Text

Good afternoon, I was looking for an easy way of copying the link text without all the trouble that it involves, and I found your extension, which does a great job, but for links. Is it possible to implement copying the link text?

Hovering over a link will make focused input lose focus

Hi :)

I noticed that with the extension active, whenever I click an input field to focus it and then move the cursor away (which I seem to do a lot, both on purpose and by mistake if i bump my mouse with my hand on the way to the keyboard) and it then hovers any link, the input field will lose focus and I'll lose whatever input I started typing.

Send notification on copy

On some situations the shortcut may not work (see e.g. caveats section).
To make the workflow more solid, it would be useful if successful copy is notified via the browser in some way,
e.g.

  • 'Link copied to clipboard'
  • OR 'Link copied to clipboard: '

Would this be welcome as an official addition? Any hints for its implementation?

Some web pages jump around when hovering links

On most sites this extension works fine, but occasionally I come across a page that jumps around with this extension enabled. The best example I currently know of is this page:

https://completionist.me/profile/1b7c0508-556e-45e2-8bee-b9f7f76f1d02

It seems this <span> element causes issues with scrollbars...

<span id="copylAddress" style="display: inline-block; position: absolute; left: -9999em;"></span>

I suspect left: -9999em; is the culprit. Why do you need this hack? Can't you just use display: none;?

console errors

if input[type=checkbox] is the document.activeElement you will get the errors
Uncaught InvalidStateError: Failed to read the 'selectionStart' property from 'HTMLInputElement': The input element's type ('checkbox') does not support selection. copylinkaddress.js:36
and
Uncaught InvalidStateError: Failed to set the 'selectionStart' property on 'HTMLInputElement': The input element's type ('checkbox') does not support selection. copylinkaddress.js:68

some input types are not supported.
https://html.spec.whatwg.org/multipage/forms.html#the-input-element:dom-textarea/input-selectionstart-3

replacing
if (window.getSelection().rangeCount > 0) {
with
if (window.getSelection().rangeCount > 0 && window.getSelection().toString()) {
would prevent document.activeElement.selectionStart from getting called on a checkbox but not other unsupported inputs with selected text.

you would probably have to check if tagname == 'input' and see if input.type is supported

var supportedtypes = ['text','search','url','tel','password']; 
if(supportedtypes.indexOf(input.type) != -1){

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.