Skip to content

Clarify that timeRemaining() is an estimate and not a fixed countdown (#37250)#44373

Open
BHUVANSH855 wants to merge 4 commits into
mdn:mainfrom
BHUVANSH855:add-popover-accessibility
Open

Clarify that timeRemaining() is an estimate and not a fixed countdown (#37250)#44373
BHUVANSH855 wants to merge 4 commits into
mdn:mainfrom
BHUVANSH855:add-popover-accessibility

Conversation

@BHUVANSH855

Copy link
Copy Markdown

Description

Adds a note to the IdleDeadline.timeRemaining() documentation clarifying that the returned value is an estimate of available idle time and should not be treated as a fixed countdown.

Motivation

The current documentation may imply that timeRemaining() continuously counts down during an idle period. However, the browser's estimate can change and may suddenly drop to 0 when higher-priority (latency-critical) work arrives. This update helps readers better understand the behavior of the API and avoid incorrect assumptions when scheduling background tasks.

Additional details

The note was added to the introduction section of the page and is based on the discussion in the linked issue regarding how browsers determine remaining idle time.

Related issues and pull requests

Fixes #37250

@BHUVANSH855 BHUVANSH855 requested a review from a team as a code owner June 7, 2026 17:12
@BHUVANSH855 BHUVANSH855 requested review from chrisdavidmills and removed request for a team June 7, 2026 17:12
@github-actions github-actions Bot added Content:WebAPI Web API docs size/xs [PR only] 0-5 LoC changed labels Jun 7, 2026
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Preview URLs (1 page)

(comment last updated: 2026-06-09 08:02:15)

@chrisdavidmills chrisdavidmills left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @BHUVANSH855, and thank you for your contribution. I've provided a couple of suggestions. I would also suggest moving the note to after the paragraph that follows it, as it looks a little weird sat below the note.

Bear in mind that I'm not an expert on this stuff; it might be good for @jyasskin to give it a quick look as well.

Comment thread files/en-us/web/api/idledeadline/timeremaining/index.md Outdated
Comment thread files/en-us/web/api/idledeadline/timeremaining/index.md Outdated
@github-actions github-actions Bot added size/s [PR only] 6-50 LoC changed and removed size/xs [PR only] 0-5 LoC changed labels Jun 8, 2026

@chrisdavidmills chrisdavidmills left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BHUVANSH855, looks good to me now. I'm just going to hold off on merging it to see if we can get some technical commentary on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

timeRemaining() documentation should flag that it doesn't just count down

3 participants