зеркало из https://github.com/mozilla/pjs.git
Bug 397443 - properly unencode URL-encoded email addresses in context menus, use implicit wrappers instead of deprecated workarounds, r=mscott
This commit is contained in:
Родитель
e05009d3e4
Коммит
480409394e
|
@ -835,13 +835,11 @@ function getEmail (url)
|
|||
else
|
||||
addresses = url.substr( mailtolength );
|
||||
// Let's try to unescape it using a character set
|
||||
// in case the address is not ASCII.
|
||||
try {
|
||||
var characterSet = Components.lookupMethod(this.target.ownerDocument, "characterSet")
|
||||
.call(this.target.ownerDocument);
|
||||
var characterSet = gContextMenu.target.ownerDocument.characterSet;
|
||||
const textToSubURI = Components.classes["@mozilla.org/intl/texttosuburi;1"]
|
||||
.getService(Components.interfaces.nsITextToSubURI);
|
||||
addresses = textToSubURI.unEscapeNonAsciiURI(characterSet, addresses);
|
||||
addresses = textToSubURI.unEscapeURIForUI(characterSet, addresses);
|
||||
}
|
||||
catch(ex) {
|
||||
// Do nothing.
|
||||
|
|
|
@ -584,8 +584,7 @@ nsContextMenu.prototype = {
|
|||
|
||||
// Let's try to unescape it using a character set
|
||||
try {
|
||||
var ownerDocument = new XPCNativeWrapper(this.target, "ownerDocument").ownerDocument;
|
||||
var characterSet = new XPCNativeWrapper(ownerDocument, "characterSet").characterSet;
|
||||
var characterSet = this.target.ownerDocument.characterSet;
|
||||
const textToSubURI = Components.classes["@mozilla.org/intl/texttosuburi;1"]
|
||||
.getService(Components.interfaces.nsITextToSubURI);
|
||||
addresses = textToSubURI.unEscapeURIForUI(characterSet, addresses);
|
||||
|
|
Загрузка…
Ссылка в новой задаче