The usefulness of Google results is reduced by all the referrer clutter which is attached as soon as you engage the link with a mouse, even to do a ctrl-click Copy Link Address
Here is a macro for simply copying a clean plain text version of the link (with the title if you want it).
Copy clean link (with title) from Google result.kmmacros (23.7 KB)
If you select any of the gray text of the Google results, and trigger the macro, it will
- use an XPath route from your selection to the html
<a>
link - bypass all the
onmousedown
noise, and simply takes the cleandata-href
or.href
contents - also take the
.text
contents
In other words from a selection like:
the XPath
./ancestor-or-self::div[@class="rc"]/h3/a
takes us to the <a>
link in,
and instead of:
https://www.google.co.uk/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&cad=rja&uact=8&sqi=2&ved=0CC4QFjACahUKEwj96LPUtZTHAhUjWdsKHeKvAok&url=https%3A%2F%2Fwww.timeshighereducation.co.uk%2Fcontent%2Fbook-review-cakes-custard-and-category-theory-by-eugenia-cheng&ei=103DVb2hPKOy7Qbi34rICA&usg=AFQjCNHlD2o_2Queoep_REAkz_dY621Luw&bvm=bv.99556055,d.ZGU
the macro simply copies:
Cakes, Custard and Category Theory: Easy Recipes - Times ...
https://www.timeshighereducation.co.uk/content/book-review-cakes-custard-and-category-theory-by-eugenia-cheng
It should be straightforward to edit the .js in the macro a little if you prefer either to drop the title string, or combine title with href in the format of a Markdown link. For example:
(function () {
var oLinkNode = document.evaluate(
document.kmvar.xPath,
window.getSelection().anchorNode,
null, 0, 0
).iterateNext();
return '[' + oLinkNode.text + '](' +
(oLinkNode.getAttribute('data-href') ||
oLinkNode.href) + ')';
})();