From 55aa47af9fcbff0a041d452175977f7120f39ad3 Mon Sep 17 00:00:00 2001 From: Gijs Kruitbosch Date: Wed, 1 Apr 2015 13:40:25 +0100 Subject: [PATCH] Bug 1147487 - don't try to reader-ize non-HTML documents, r=margaret,jaws --HG-- extra : rebase_source : 107eb010f3c7967e038b7a0b4895425e4e3e7312 --- toolkit/components/reader/ReaderMode.jsm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/toolkit/components/reader/ReaderMode.jsm b/toolkit/components/reader/ReaderMode.jsm index 84184648a204..4c620b99609d 100644 --- a/toolkit/components/reader/ReaderMode.jsm +++ b/toolkit/components/reader/ReaderMode.jsm @@ -68,8 +68,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; }