summaryrefslogtreecommitdiff
path: root/common/modules
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2011-10-27 01:09:13 -0400
committerKris Maglione <maglione.k@gmail.com>2011-10-27 01:09:13 -0400
commit11deba65e938a8a29115edef433ebe7d90bf24ac (patch)
treefd2733525fe80b350524d024b90aa3cfdea23101 /common/modules
parente50726ae01ab3c174c63f3072a6667fcc8b4aee3 (diff)
downloadpentadactyl-11deba65e938a8a29115edef433ebe7d90bf24ac.tar.gz
Yank short URL with 'y' if provided.
Diffstat (limited to 'common/modules')
-rw-r--r--common/modules/buffer.jsm6
1 files changed, 5 insertions, 1 deletions
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-location>"], "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],
["<C-a>", "<increment-url-path>"], "Increment last number in URL",