Bug 1157682 - ignore querystring / hash when determining 'home page' for reader mode, r=margaret

--HG--
extra : rebase_source : e600d13390e1f36a009d4a8e31fc9d594e7c27b5
This commit is contained in:
Gijs Kruitbosch 2015-04-23 14:38:58 +01:00
Родитель 7f9da983fa
Коммит 46f3b97701
1 изменённых файлов: 10 добавлений и 4 удалений

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

@ -240,13 +240,19 @@ this.ReaderMode = {
},
_shouldCheckUri: function (uri) {
if ((uri.prePath + "/") === uri.spec) {
this.log("Not parsing home page: " + uri.spec);
if (!(uri.schemeIs("http") || uri.schemeIs("https") || uri.schemeIs("file"))) {
this.log("Not parsing URI scheme: " + uri.scheme);
return false;
}
if (!(uri.schemeIs("http") || uri.schemeIs("https") || uri.schemeIs("file"))) {
this.log("Not parsing URI scheme: " + uri.scheme);
try {
uri.QueryInterface(Ci.nsIURL);
} catch (ex) {
// If this doesn't work, presumably the URL is not well-formed or something
return false;
}
if (!uri.filePath || uri.filePath == "/") {
this.log("Not parsing home page: " + uri.spec);
return false;
}