From 11deba65e938a8a29115edef433ebe7d90bf24ac Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Thu, 27 Oct 2011 01:09:13 -0400 Subject: [PATCH] Yank short URL with 'y' if provided. --- common/modules/buffer.jsm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/modules/buffer.jsm b/common/modules/buffer.jsm index 49548dd2..32565838 100644 --- a/common/modules/buffer.jsm +++ b/common/modules/buffer.jsm @@ -1833,7 +1833,11 @@ var Buffer = Module("Buffer", { mappings.add([modes.NORMAL], ["y", ""], "Yank current location to the clipboard", - function () { dactyl.clipboardWrite(buffer.uri.spec, true); }); + function () { + let link = DOM("link[href][rev=canonical], link[href][rel=shortlink]", buffer.doc); + let url = link.length ? link.attr("href") : buffer.uri.spec; + dactyl.clipboardWrite(url, true); + }); mappings.add([modes.NORMAL], ["", ""], "Increment last number in URL",