Closed Bug 1826245 Opened 2 years ago Closed 2 years ago

Convert ReaderView (readerview@mozac.org) extension to event pages

Categories

(Fenix :: Browser Engine, task, P2)

All
Android
task

Tracking

(firefox118 fixed)

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: cpeterson, Assigned: rpl)

References

Details

(Whiteboard: [addons-jira])

Attachments

(1 file, 4 obsolete files)

The ReaderView (readerview@mozac.org) extension must be updated to use event pages because it currently uses persistent background pages or scripts, which will be incompatible with the extension process.

How to convert an extension using a persistent background script to event pages:

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Background_scripts#convert_to_non-persistent

The background script stores data in a local variable (Map). This won’t work well when the background script is terminated. A storage API (session) should be used instead.

I have just gave a quick try to convert readerview@mozac.org from a persistent background script to an event page, as mentioned in comment 0 the only detail that needed to be adjusted is the Map kept in the background page to be using storage.session API instead. I have then used the STRs we have put together for QA to verify the behaviors on the extension process crashes to verify that: - the readerview event page is being suspended on idle as expected - webpages recognized as articles successfully switch to reader mode before a crash - and then after a crash, confirm that: - an existing tab in readerview mode is shown the usual "tab crashed UI" available on Fenix, and clicking "Restore tab" does restore the tab in readerview mode as it was before the process crashed - clicked the readerview mode on a tab that was not in readerview mode, does spawn the event page and switch the tab to the readermode view as expected The attached patch includes the diff with the current set of changes I've applied locally.
Attachment #9348391 - Attachment description: OK → DRAFT - port readerview@ac persistent background page to an event page
Attachment #9348391 - Attachment filename: pasted.txt → DRAFT_convert_readerview_to_eventpage.patch
Attachment #9348392 - Attachment is obsolete: true
Attachment #9348393 - Attachment is obsolete: true
Attachment #9348394 - Attachment is obsolete: true
Assignee: nobody → lgreco
Status: NEW → ASSIGNED

Comment on attachment 9348391 [details]
DRAFT - port readerview@ac persistent background page to an event page

superseded by the pull request attached in comment 5.

Attachment #9348391 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Flags: qe-verify+
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
Flags: qe-verify+
Blocks: 1823436
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: