recording_helpers.ts view source
(event: BeforeUnloadEvent, recorder: { readonly active: boolean; } | undefined): void import {confirm_unload_while_recording} from '@fuzdev/zzz/recording_helpers.js'; Handles beforeunload: while the microphone is live, asks the browser to
confirm leaving the page, since that ends the recording.
event
the beforeunload event
BeforeUnloadEventrecorder
the app's recorder, if there's an app
{ readonly active: boolean; } | undefinedreturns
void mutates
event— cancels it (`preventDefault` plus the legacy `returnValue`) to ask for confirmation