Closed Bug 1107588 Opened 5 years ago Closed 5 years ago
Support adding content from URLs that redirect to the reader mode cache
MozReview Request: Bug 1107588 - Use an xhr to download reader mode content instead of creating new browser elements
39 bytes, text/x-review-board-request
No description provided.
To clarify, this bug is about updating _downloadAndParseDocument  to handling downloading any URL that redirects any number of ways. Currently we haven't really found this to be much of a problem in practice because we only ever go through _downloadAndParseDocument as a fallback if a tab with an article has never been loaded. The only way to do this in the UI is to add an article from the share overlay, then try to load it from your reading list. However, that's a way we want to start supporting with bug 1093172. Currently, we use a browser to download this document, but we should also investigate whether or not we can just do with with an XHR. I made a patch with this change in bug 793920, but we decided to split that off, since it felt like scope creep. I need to sit down to do some more investigation about how we're failing, but there are problems with our current approach, as well as the XHR approach. My insidious redirect testcase is the pocket hits feed, which has URLs that do two different kinds of redirects before resolving to the final URL. http://pocket.co/sBYec http://getpocket.com/s/BYec http://well.blogs.nytimes.com/2014/12/03/run-to-stay-young  http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/Reader.js#200
/r/1809 - Bug 1107588 - Use an xhr to download reader mode content instead of creating new browser elements Pull down this commit: hg pull review -r 9a78e3c7f8aa2bd4dd182d3ec29091157b6a0136
I can find no reason why an xhr causes a regression as opposed to using a <browser>. I very much prefer the xhr approach because it is simpler, and we can do it in a window-less jsm context, which will help to share this code with desktop. In this patch, I added a bit of a hacky approach to deal with meta refresh redirects, but we don't even support those properly with the current <browser> approach. I tested with these URLs, let me know if you can think of other redirect testcases: http://pocket.co/snupv http://getpocket.com/s/nupv https://t.co/wV1ymMoEB1
Attachment #8542659 - Flags: review?(mark.finkle) → review+
https://reviewboard.mozilla.org/r/1807/#review1223 LGTM. Let's see if any regressions kick in.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 37
You need to log in before you can comment on or make changes to this bug.