Created attachment 622681 [details] [diff] [review]
This JS error happens at least:
- on the Chat tab (when no textbox has the focus)
- on the Gloda facet view tab
- on chromeTab (which is a bit surprising, given that the method works for contentTab).
The attached patch returns early if the currently selected tab is neither a mail tab nor a contentTab.
I'm not sure it's a good solution, but it does fix the noisy JS error.
Other possible approaches:
- just add a null check on the contentWindow variable
- attempt to rewrite the whole function in a way that would make more sense; maybe using the getBrowser method of tabs (I haven't tried this because I'm not sure I fully understand the current code; it took me a while to understand what the _mailrssiframe stuff was, it seemed like dead code at first).
Comment on attachment 622681 [details] [diff] [review]
I think I would prefer a contentWindow null check, so that we can add other different tab types in future (one of which mconley might be adding right now)…
So, r-, but given the simplicity, you can get an automatic r=me if you implement that version. ;)
Created attachment 623986 [details] [diff] [review]
Patch v2 (simple null check)
Carrying forward Blake's "automatic r=me if you implement that version".