mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 15:28:39 +09:00
Issue #1706 - Improve copying from the location bar, stop encoding parentheses explicitly
This commit is contained in:
parent
df37b6046c
commit
ad32641c0b
1 changed files with 11 additions and 7 deletions
|
|
@ -505,11 +505,16 @@
|
|||
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 +526,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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue