Closed Bug 1821490 Opened 2 years ago Closed 2 years ago

New tab page updates should pause when the user is away and resume immediately when the user is back

Categories

(Firefox :: New Tab Page, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
113 Branch
Tracking Status
firefox113 --- fixed

People

(Reporter: florian, Assigned: florian)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

browser/components/newtab/lib/SystemTickFeed.jsm uses a repeating 5 minutes timer to update the new tab page. I think the intent is to ensure the data is always fresh, but this is wasteful when the user is away from the computer for an extended duration.

I think we could instead implement the following behavior:

  • when the 5 minutes timer fires, if the user has been inactive from more than 5 minutes, remove the timer and instead add an observer to be notified the next time there is user activity.
  • when there is user activity again, trigger an update immediately and restart the timer.
  • to minimize the risk of the update getting in the way of processing user events, trigger updates using ChromeUtils.idleDispatch.
Pushed by fqueze@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5cf233ef78b2 New tab page updates should pause when the user is away and resume immediately when the user is back, r=thecount.
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
Blocks: 1736916
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: