Copy Link Under the Cursor as Text in Safari or Google Chrome

This is a macro by @ComplexPoint.

I was looking for it on the forum and didn't find it, so I'm reposting.

The macro is very similar to this one:

Copy link under cursor in Safari or Chrome as Markdown

But it does NOT reformat the link (or links) as Markdown – it returns plain text.

-Chris


Copy Webpage Link Under the Cursor.kmmacros (25 KB)

Chris,

Thanks for the macro. I like having a version that just returns the URL as plain text.

I've having trouble with getting it to recognize the mailto URL on this page, when just hovering over it. If I select the email link, then it processes it correctly. Any ideas on how to fix?

https://account.dyn.com/support/contact/email.html

Hey JM,

I had some troubles with it in both Safari and Chrome on that page, but I resolved them by refreshing the page and/or moving the cursor to a different spot on the link.

Try refreshing the page and running the macro on various links on the page.

I still don't savvy JavaScript and Xpath well enough to know if it can be improved.

I'm not seeing anything in the macro's logics that might cause the glitch.

This macro is about 8 months old, and @ComplexPoint has learned quite a bit since then. Perhaps he knows how to make it more bombproof.

-Chris