Closed Bug 875076 Opened 7 years ago Closed 5 years ago

JavaScript Error: "elem is undefined" {file: "chrome://browser/content/Readability.js" line: 250}

Categories

(Firefox for Android :: Reader View, defect)

All
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 36

People

(Reporter: nalexander, Assigned: Margaret)

References

Details

Attachments

(1 file)

I Gecko(8948)                 JSDOMParser error: expected '</script>'
I Gecko(8948)                 JSDOMParser error: expected '</head>'
I Gecko(8948)                 JSDOMParser error: expected '</html>'
E GeckoConsole(8948)          [JavaScript Error: "elem is undefined" {file: "chrome://browser/content/Readability.js" line: 250}]

This is from a build with a few patches on top of https://hg.mozilla.org/services/services-central/rev/97f49d0b228c
Boom, ran into this in one of the testcases in bug 786638. Going to investigate.
Assignee: nobody → margaret.leibovic
We check if the body is null here, but actually it's undefined. We should use the magic of JS to handle both cases.

However, while investigating this, I found that this happened on the first of two "pageshow" events for a page load (testing the arstechnica.com page from bug 786638). I don't know why we would be getting two "pageshow" events, and it makes me wonder if there's another bug here.

Also, maybe we should just bail early in _readerParse if there isn't a valid document.
Attachment #8525019 - Flags: review?(bnicholson)
Comment on attachment 8525019 [details] [diff] [review]
Fix undefined element error in Readability.js

Review of attachment 8525019 [details] [diff] [review]:
-----------------------------------------------------------------

Heh, looks like this is a regression from bug 868936. Looking through that patch, I don't see any other null comparison changes, so hopefully an isolated issue.
Attachment #8525019 - Flags: review?(bnicholson) → review+
Blocks: 868936
https://hg.mozilla.org/mozilla-central/rev/13db49ad9170
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 36
You need to log in before you can comment on or make changes to this bug.