summaryrefslogtreecommitdiffstats
path: root/webbrowser/base
diff options
context:
space:
mode:
authorThomas Groman <tgroman@nuegia.net>2020-04-20 23:09:53 -0700
committerThomas Groman <tgroman@nuegia.net>2020-04-20 23:09:53 -0700
commitdb5d9bb29f8e740192e83af5c4ddb74caaa7188c (patch)
tree8bb160f4a0c5de21ae62f4a61536a26c3034aba4 /webbrowser/base
parent83bdb7892d1ffa1a929db95bdb4ecc3f69a27b50 (diff)
downloadwebbrowser-db5d9bb29f8e740192e83af5c4ddb74caaa7188c.tar
webbrowser-db5d9bb29f8e740192e83af5c4ddb74caaa7188c.tar.gz
webbrowser-db5d9bb29f8e740192e83af5c4ddb74caaa7188c.tar.lz
webbrowser-db5d9bb29f8e740192e83af5c4ddb74caaa7188c.tar.xz
webbrowser-db5d9bb29f8e740192e83af5c4ddb74caaa7188c.zip
issue #1706 - Improve copying from location bar, stop encoding parenthesis explicitly
(https://github.com/MoonchildProductions/Pale-Moon/issues/1706)
Diffstat (limited to 'webbrowser/base')
-rw-r--r--webbrowser/base/content/urlbarBindings.xml17
1 files changed, 10 insertions, 7 deletions
diff --git a/webbrowser/base/content/urlbarBindings.xml b/webbrowser/base/content/urlbarBindings.xml
index d2d9cc7..31d6aa5 100644
--- a/webbrowser/base/content/urlbarBindings.xml
+++ b/webbrowser/base/content/urlbarBindings.xml
@@ -505,11 +505,15 @@
let uriFixup = Cc["@mozilla.org/docshell/urifixup;1"].getService(Ci.nsIURIFixup);
let uri;
- try {
- uri = uriFixup.createFixupURI(inputVal, Ci.nsIURIFixup.FIXUP_FLAG_NONE);
- } catch (e) {}
- if (!uri)
- return selectedVal;
+
+ if (this.getAttribute("pageproxystate") == "valid") {
+ uri = gBrowser.currentURI;
+ } else {
+ // We're dealing with an autocompleted value, create a new URI from that.
+ try { uri = uriFixup.createFixupURI(inputVal, Ci.nsIURIFixup.FIXUP_FLAG_NONE); } catch (e) {}
+ if (!uri)
+ return selectedVal;
+ }
// Only copy exposable URIs
try {
@@ -521,8 +525,7 @@
// ... 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")) {
- // Parentheses are known to confuse third-party applications (bug 458565).
- selectedVal = uri.spec.replace(/[()]/g, function (c) escape(c));
+ selectedVal = uri.spec;
}
return selectedVal;