mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-08 04:54:11 +01:00
Strip utm_* crud from URLs on yank.
This commit is contained in:
@@ -1836,6 +1836,10 @@ var Buffer = Module("Buffer", {
|
||||
["y", "<yank-location>"], "Yank current location to the clipboard",
|
||||
function () {
|
||||
let { doc, uri } = buffer;
|
||||
if (uri instanceof Ci.nsIURL)
|
||||
uri.query = uri.query.replace(/(?:^|&)utm_[^&]+/g, "")
|
||||
.replace(/^&/, "");
|
||||
|
||||
let link = DOM("link[href][rev=canonical], link[href][rel=shortlink]", doc);
|
||||
let url = link.length && options.get("yankshort").getKey(uri) ? link.attr("href") : uri.spec;
|
||||
dactyl.clipboardWrite(url, true);
|
||||
|
||||
Reference in New Issue
Block a user