Bug 1380617 - Make the PageInfo panel return unicode URLs r=Gijs
- fixing the hostName in getWindowInfo fixes the issue across the PageInfo panel
- fixing docInfo.referrer also fixes the Referring URL on the General tab
MozReview-Commit-ID: 9x9uWp2R3Yj
--- a/browser/base/content/content.js
+++ b/browser/base/content/content.js
@@ -1187,28 +1187,36 @@ var PageInfoListener = {
},
getWindowInfo(window) {
let windowInfo = {};
windowInfo.isTopWindow = window == window.top;
let hostName = null;
try {
- hostName = window.location.host;
+ hostName = Services.io.newURI(window.location.href).displayHost;
} catch (exception) { }
windowInfo.hostName = hostName;
return windowInfo;
},
getDocumentInfo(document) {
let docInfo = {};
docInfo.title = document.title;
docInfo.location = document.location.toString();
+ try {
+ docInfo.location = Services.io.newURI(document.location.toString()).displaySpec;
+ } catch (exception) { }
docInfo.referrer = document.referrer;
+ try {
+ if (document.referrer) {
+ docInfo.referrer = Services.io.newURI(document.referrer).displaySpec;
+ }
+ } catch (exception) { }
docInfo.compatMode = document.compatMode;
docInfo.contentType = document.contentType;
docInfo.characterSet = document.characterSet;
docInfo.lastModified = document.lastModified;
docInfo.principal = document.nodePrincipal;
let documentURIObject = {};
documentURIObject.spec = document.documentURIObject.spec;