Bug 1147487 - Don't try to reader-ize non-HTML documents. r=margaret, r=jaws, a=lmandel

This commit is contained in:
Gijs Kruitbosch
2015-04-01 13:40:25 +01:00
parent 7e27ac6a9a
commit ce126f03c0

View File

@@ -118,8 +118,12 @@ this.ReaderMode = {
* @return boolean Whether or not we should show the reader mode button.
*/
isProbablyReaderable: function(doc) {
let uri = Services.io.newURI(doc.location.href, null, null);
// Only care about 'real' HTML documents:
if (doc.mozSyntheticDocument || !(doc instanceof doc.defaultView.HTMLDocument)) {
return false;
}
let uri = Services.io.newURI(doc.location.href, null, null);
if (!this._shouldCheckUri(uri)) {
return false;
}