mirror of
https://github.com/penpot/penpot.git
synced 2026-11-06 01:50:39 +00:00
Bringing the tab forward wakes a frozen page, but it takes the user away from what they are doing, and on some window managers the window does not come forward at all, so the page stays frozen. The extension now unfreezes the page in place: it attaches the debugger to the tab, sets the page lifecycle state to active and detaches, without switching tabs. Chrome shows a debugging notice while the extension is attached, and requires the debugger permission at install, since it cannot be optional. When the debugger fails, for instance with DevTools open on the tab, the extension brings the tab forward and goes back to the tab and window that had the focus once the page reports that it runs again, or after 5 s. It goes back only while the woken tab still has the focus, so it does not take away a tab the user chose meanwhile. The content script tells the service worker when its page resumes or becomes visible. The popup shows the last wake request and what the extension did, which the wake result also sends to the server's log.