Расширение Chrome — обновление вкладки по времени

Жизненный цикл вкладки Chrome: когда фактически срабатывает перезагрузка

Reload fires when a Chrome alarm reaches the service worker — not when a script inside the page happens to be awake.

Tabs sleep, discard, and get discarded by memory pressure. Popups close. Page timers die with the document. Auto Refresh Turbo keeps the schedule in an extension service worker and calls tabs.reload when the alarm fires, which is why the countdown can outlive the popup.

Actors in the timeline

  • Service worker — owns session state and the next alarm
  • chrome.alarms — wakes the worker for the scheduled tick
  • tabs.reload — performs normal or hard reload for that tab id
  • Popup / badge / optional on-page chip — views of time remaining; not the authority

Deep product path: how automatic tab refresh works.

A single cycle

  1. You press Start with an interval (fixed or random) for a tab
  2. The worker stores the session and arms the next alarm
  3. UI surfaces show time remaining
  4. The alarm fires → Chrome reloads the tab
  5. If the session continues, the next delay is armed
  6. Schedule rules, stop-after-N, interaction stop, or suspicious-page stop may pause or end the loop

When the tab is in the background

Background tabs can be throttled for page JavaScript. That is one reason a content-script-only timer is a weak core loop. Alarms + worker scheduling are meant to keep reload attempts aligned with your interval even when the page is not focused — subject to Chrome’s own extension and power policies.

Discarded and frozen tabs

Chrome may discard a tab to free memory. A later reload still targets the tab id if the session remains valid; the document loads fresh. If a tab was closed entirely, that session should end — closed tabs are not silent zombies.

Service worker restarts

Workers can sleep. Persisted snapshots in local storage help rebuild sessions after restart. URLs and intervals are stored for that restore path, not to build a browsing-history product. See Privacy Policy.

Closing the popup does not Stop the session: the worker keeps the alarm, and reopening the popup should show remaining time again. Press Stop when you mean to end refresh.

Schedule windows and the clock

Outside a daily window the session is paused: alarms should not reload until the window opens. That is not Stop. Clarify states in schedule paused vs stopped and daily schedule.

After reload, UI remounts

A full reload creates a new document. An optional visual timer remounts and resyncs with the worker. Early inject keeps the gap short; the worker still decides the next fire time.

What can block a fire

  • Schedule pause
  • Stop / stop-after-N
  • Stop on click/type
  • Suspicious-page stop
  • Missing permissions or a non-reloadable URL scheme

Walkthrough: troubleshooting.

Multi-tab timing

Each tab session has its own alarms and options. Five tabs mean five independent lifecycles — useful for walls, easy to over-load a single origin if you are not careful (rate limits).

Try it

Install Auto Refresh Turbo, start a 30-second session, close the popup, and confirm the tab still reloads on schedule.

Related

Продолжайте исследовать

Интересно