idle API: no way to reset the interval to default after idle.setDetectionInterval() #452
Labels
discussion
Needs further discussion
enhancement
Enhancement or change to an existing feature
proposal
Proposal for a change or new feature
TL;DR: the default interval is not exposed so to revert it back to the initial value you have to hardcode the number from the documentation.
from: https://developer.chrome.com/docs/extensions/reference/idle/#method-setDetectionInterval (similar page on mdn)
Once you set the interval, it persists. There's no way to revert to the default interval. There's no way to read the current interval.
It would be nice to expose the default value, like so:
Similarly, there's no mention of the interval's minimum.
await chrome.idle.queryState(10)
throws (at least in Chrome)It would be nice to expose:
Currently, I have to program defensively and wrap each setDetectionInterval and queryState call into try/catch, in case the minimum interval constant changes.
The text was updated successfully, but these errors were encountered: