summaryrefslogtreecommitdiffstats
path: root/webbrowser/base/content
diff options
context:
space:
mode:
authorThomas Groman <tgroman@nuegia.net>2020-05-08 01:51:36 -0700
committerThomas Groman <tgroman@nuegia.net>2020-05-08 01:51:36 -0700
commit12ff2f06ad611371200ae5625319b497a7cbfb13 (patch)
tree950d1d6459ac9fd3a1719620183752f5df4431cf /webbrowser/base/content
parent60a9bc8421ebfb6e9a8ed563d15fa157cfcf796a (diff)
downloadwebbrowser-12ff2f06ad611371200ae5625319b497a7cbfb13.tar
webbrowser-12ff2f06ad611371200ae5625319b497a7cbfb13.tar.gz
webbrowser-12ff2f06ad611371200ae5625319b497a7cbfb13.tar.lz
webbrowser-12ff2f06ad611371200ae5625319b497a7cbfb13.tar.xz
webbrowser-12ff2f06ad611371200ae5625319b497a7cbfb13.zip
Add pref to allow copying unescaped URL from the URL bar
Diffstat (limited to 'webbrowser/base/content')
-rw-r--r--webbrowser/base/content/urlbarBindings.xml20
1 files changed, 9 insertions, 11 deletions
diff --git a/webbrowser/base/content/urlbarBindings.xml b/webbrowser/base/content/urlbarBindings.xml
index 31d6aa5..7da925f 100644
--- a/webbrowser/base/content/urlbarBindings.xml
+++ b/webbrowser/base/content/urlbarBindings.xml
@@ -520,19 +520,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) {