diff options
author | JustOff <Off.Just.Off@gmail.com> | 2020-04-09 00:59:57 +0300 |
---|---|---|
committer | JustOff <Off.Just.Off@gmail.com> | 2020-04-09 00:59:57 +0300 |
commit | 9689c4c34988507dc26930066f34f2e75aa839da (patch) | |
tree | 56c54e8f40c00bdc83488398cea04fecb00e20fb | |
parent | 148f4337ba16827819852c15cd237e5e1fa18f20 (diff) | |
download | palemoon-9689c4c34988507dc26930066f34f2e75aa839da.tar.gz |
Issue #1766 - Add pref to allow copying unescaped URL from the URL bar
-rw-r--r-- | palemoon/app/profile/palemoon.js | 4 | ||||
-rw-r--r-- | palemoon/base/content/urlbarBindings.xml | 20 |
2 files changed, 13 insertions, 11 deletions
diff --git a/palemoon/app/profile/palemoon.js b/palemoon/app/profile/palemoon.js index 476965260..1528d90ba 100644 --- a/palemoon/app/profile/palemoon.js +++ b/palemoon/app/profile/palemoon.js @@ -329,6 +329,10 @@ pref("browser.identity.display_punycode", 1); // Address bar RSS icon control, show by default pref("browser.urlbar.rss", true); +// If changed to true, copying the entire URL from the location bar will put +// the human readable (percent-decoded) URL on the clipboard. +pref("browser.urlbar.decodeURLsOnCopy", false); + pref("browser.altClickSave", true); // Enable logging downloads operations to the Error Console. diff --git a/palemoon/base/content/urlbarBindings.xml b/palemoon/base/content/urlbarBindings.xml index 71a74a036..ae9b8d58f 100644 --- a/palemoon/base/content/urlbarBindings.xml +++ b/palemoon/base/content/urlbarBindings.xml @@ -521,19 +521,17 @@ uri = uriFixup.createExposableURI(uri); } catch (ex) {} - // If the entire URL is selected, just use the actual loaded URI. - if (inputVal == selectedVal) { - // ... but only if isn't a javascript: or data: URI, since those - // are hard to read when encoded - if (!uri.schemeIs("javascript") && !uri.schemeIs("data")) { - selectedVal = uri.spec; - } - - return selectedVal; + // If the entire URL is selected, just use the actual loaded URI, + // unless we want a decoded URI, or it's a data: or javascript: URI, + // since those are hard to read when encoded. + if (inputVal == selectedVal && + !uri.schemeIs("javascript") && !uri.schemeIs("data") && + !Services.prefs.getBoolPref("browser.urlbar.decodeURLsOnCopy")) { + return uri.spec; } - // Just the beginning of the URL is selected, check for a trimmed - // value + // Just the beginning of the URL is selected, or we want a decoded + // url. First check for a trimmed value. let spec = uri.spec; let trimmedSpec = this.trimValue(spec); if (spec != trimmedSpec) { |