Fix issue with entering readerview mode on pages where the document can't be retrieved using XMLHttpRequest
Categories
(Fenix :: WebExtensions, defect, P1)
Tracking
(firefox119 wontfix, firefox120 verified, firefox121 verified)
People
(Reporter: rpl, Assigned: rpl)
References
Details
(Whiteboard: [addons-jira])
Attachments
(3 files)
Steps to reproduce
- open
https://addons.mozilla.org/en-US/firefox/addon/tree-style-tab/
in a new Fenix tab - click the readerview icon
Expected behavior
The content of the tree-style-tab document to be rendered in readerview mode
Actual behavior
The tab gets reloaded automatically on Nightly, while on Beta and Release the tab stays empty, in both cases the tab doesn't enter the readerview mode.
Device information
Reproduced on Fenix 120 on the emulator (and 119 and 118 on a real android device, Pixel 6a with Android 13).
Any additional information?
While investigating this issue I determined that the "tab reload" part of the actual behavior is triggered by readerview.js itself from here when it fails to retrive a doc for the page we want to render in readerview mode.
The issue can be triggered consistently on the addons.mozilla.org detail page because retrieving the page using XMLHttpRequest seems to be failing (because it is hitting a CORS related error Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://addons.mozilla.org/en-US/firefox/addon/tree-style-tab/. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.)
error), and in that case we will be trying to retrieve the doc through the getSerializedDoc
runtime message, which was also not providing a cached doc.
After looking more closely to why the doc wasn't returned by getSerializedDoc
, I applied some more fixes to the readerview background script to make it to correctly provide the reply to the getSerializedDoc message, and with just that change applied locally I was able to enter and exit readerview mode on the tree-style-tab AMO detail page as expected.
Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 1•1 year ago
|
||
Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 2•1 year ago
|
||
Authored by https://github.com/rpl
https://github.com/mozilla-mobile/firefox-android/commit/366590642b7b823a42717b7c45963f9638df4423
[main] Bug 1860130 - Fix getSerializedDoc message reply in readerview-background.js
Comment 3•1 year ago
|
||
Luca, do you want to uplift your fix to Beta 120 for the addons GA release in 120? Or can your fix ride the trains with 121?
Comment 4•1 year ago
|
||
Yes, we want to uplift this.
Comment 6•1 year ago
•
|
||
Verified as fixed on Nightly 120.0a1 from 01/11 with Assus Zenfone 9 ( Android 13) and Sony Xperia (Android 6.0.1).
Comment 7•1 year ago
|
||
Comment 8•1 year ago
|
||
:boek looks like Luca is on pto, since you are the reviewer... do you mind requesting an uplift for this for fx120?
Comment 9•1 year ago
|
||
(In reply to Adina Petridean from comment #6)
Verified as fixed on Nightly 120.0a1 from 09/29 with Assus Zenfone 9 ( Android 13) and Sony Xperia (Android 6.0.1).
I am guessing this is 121.0a1 and not 120?
Updated•1 year ago
|
Comment 10•1 year ago
|
||
Comment 11•1 year ago
|
||
Comment on attachment 9361677 [details] [review]
[mozilla-mobile/firefox-android] Bug 1860130 - Fix getSerializedDoc message reply in readerview-background.js (backport #4170) (#4336)
Beta/Release Uplift Approval Request
- User impact if declined: Reader mode will be broken for pages that cannot load within the readermode scripts.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: 1. open https://addons.mozilla.org/en-US/firefox/addon/tree-style-tab/ in a new Fenix tab
- click the readerview icon
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Patch has landed and been tested in Nightly
- String changes made/needed:
- Is Android affected?: Yes
Updated•1 year ago
|
Comment 12•1 year ago
|
||
Comment 13•1 year ago
|
||
Authored by https://github.com/rpl
https://github.com/mozilla-mobile/firefox-android/commit/d2f865e84dcc2d95619f60e3f5c9e9f7da8afe53
[releases_v120] Bug 1860130 - Fix getSerializedDoc message reply in readerview-background.js
Comment 14•1 year ago
|
||
Verified as fixed on Firefox Beta 120.0b6 from 06/11 with Huawei MediaPad M2 (Android 5.1.1) and Motorola G9 plus (Android 11).
Description
•