Bug 1338867 - Strip username/password after strip reader mode url prefix, r=sebastian

MozReview-Commit-ID: KCr7cBdetq7

--HG--
extra : rebase_source : 7aa4614a8664be1a40ac1a857adf92b592125e4d
This commit is contained in:
Carsten "Tomcat" Book 2017-03-14 14:07:57 +08:00
Родитель e09c6c1b10
Коммит f2b3183dfe
1 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -4501,6 +4501,9 @@ Tab.prototype = {
ExternalApps.updatePageActionUri(fixedURI);
}
// Strip reader mode URI and also make it exposable if needed
fixedURI = this._stripAboutReaderURL(fixedURI);
let message = {
type: "Content:LocationChange",
tabID: this.id,
@ -4529,8 +4532,15 @@ Tab.prototype = {
}
},
_stripAboutReaderURL: function (url) {
return ReaderMode.getOriginalUrl(url) || url;
_stripAboutReaderURL: function (originalURI) {
try {
let strippedURL = ReaderMode.getOriginalUrl(originalURI.spec);
if(strippedURL){
// Continue to create exposable uri if original uri is stripped.
originalURI = URIFixup.createExposableURI(Services.io.newURI(strippedURL));
}
} catch (ex) { }
return originalURI;
},
// Properties used to cache security state used to update the UI