Skip to content

The free and privacy-friendly screen recorder with no limits 🎥

Improve recording recovery, editor fallbacks, and Drive reliability

Alyssa X7c660b544b0f
diff --git a/src/_locales/ca/messages.json b/src/_locales/ca/messages.json
index c798f81..435f7cd 100644
--- a/src/_locales/ca/messages.json
+++ b/src/_locales/ca/messages.json
@@ -1458,8 +1458,8 @@
"description": "Toast shown when a crashed recording session is auto-recovered on startup"
},
"toastStorageCritical": {
- "message": "Low disk space detected. Recording is stopping to avoid corruption.",
- "description": "Toast shown when available storage drops below the critical threshold during recording"
+ "message": "Poc espai al disc. S'està desant l'enregistrament. Tot el que s'ha capturat és segur.",
+ "description": "Toast shown when available storage drops below the critical threshold during recording; reassures that captured data is preserved"
},
"toastStorageLow": {
"message": "Storage is running low. Upload reliability may degrade for long recordings.",
@@ -1472,5 +1472,105 @@
"toastNetworkOffline": {
"message": "Network offline. Upload paused. Screen chunks are saved locally.",
"description": "Toast shown when the browser goes offline during a cloud recording upload"
+ },
+ "longRecordingTitle": {
+ "message": "Enregistrament llarg",
+ "description": "Banner title shown when a recording exceeds the local processing limit but is otherwise successful"
+ },
+ "longRecordingDescription": {
+ "message": "El teu enregistrament és complet i segur. Descarrega'l com a WebM a continuació.",
+ "description": "Banner description for long recordings that can be downloaded but not edited locally"
+ },
+ "notAvailableLongRecording": {
+ "message": "No disponible per a enregistraments llargs",
+ "description": "Disabled button label for features not available due to recording length"
+ },
+ "notAvailableRecoveryMode": {
+ "message": "No disponible en mode de recuperació",
+ "description": "Disabled button label for features not available in recovery/fallback mode"
+ },
+ "editTooLongTitle": {
+ "message": "Edició d'àudio massa llarga",
+ "description": "Alert title when an audio mute/mix edit is rejected because the clip exceeds 15 minutes"
+ },
+ "editTooLongDescription": {
+ "message": "Aquesta edició d'àudio no és compatible amb clips de més de 15 minuts. L'original no s'ha modificat. Prova a retallar el clip primer.",
+ "description": "Alert body explaining the 15-minute limit and suggesting trimming first"
+ },
+ "editTimeoutTitle": {
+ "message": "L'edició ha superat el temps d'espera",
+ "description": "Alert title when an edit operation does not complete within the 5-minute watchdog period"
+ },
+ "editTimeoutDescription": {
+ "message": "L'edició no s'ha completat a temps. L'enregistrament original no s'ha modificat. Torna a intentar-ho o retalla el clip primer.",
+ "description": "Alert body for the timeout case, prompting retry or shorter clip"
+ },
+ "streamEndedWarningToast": {
+ "message": "La compartició de pantalla s'ha aturat. L'enregistrament s'ha desat. Atura quan vulguis.",
+ "description": "Toast shown when screen share track ends mid-recording. Recording continues; removes false urgency about data loss."
+ },
+ "recoveryModeDescription": {
+ "message": "Hi ha hagut un problema de processament, però l'enregistrament és segur. Pots descarregar-lo a continuació.",
+ "description": "Recovery mode banner description — reassures user their recording is accessible despite the processing failure"
+ },
+ "editProcessingSafeDescription": {
+ "message": "S'està processant l'edició. L'enregistrament original no s'ha modificat.",
+ "description": "Shown in the editor processing alert when a user-initiated edit is running, to reassure the original is safe"
+ },
+ "editFailedTitle": {
+ "message": "No s'ha pogut aplicar l'edició",
+ "description": "Alert title when an edit operation fails due to an encoding or processing error"
+ },
+ "editFailedDescription": {
+ "message": "Alguna cosa ha fallat durant el processament. L'enregistrament original és segur. Pots tornar-ho a provar o descarregar-lo tal com és.",
+ "description": "Alert body for edit failure; explicitly confirms the original recording is untouched"
+ },
+ "videoTrackEndedToast": {
+ "message": "La compartició de pantalla s'ha aturat. S'està desant l'enregistrament. Tot el que s'ha capturat és segur.",
+ "description": "Toast shown when the video track ends mid-recording (e.g. monitor disconnected, screen share revoked)"
+ },
+ "audioTrackEndedToast": {
+ "message": "L'àudio s'ha desconnectat. S'està desant l'enregistrament. El vídeo capturat és segur.",
+ "description": "Toast shown when the audio track ends mid-recording (e.g. mic unplugged, permission revoked)"
+ },
+ "editorRecoveryToast": {
+ "message": "L'enregistrament s'ha desat. L'editor no s'ha obert. Fes clic a la icona de Screenity per tornar-ho a provar.",
+ "description": "Toast shown on the active tab when the post-recording editor tab fails to open"
+ },
+ "stopAckTimeoutToast": {
+ "message": "El desament està trigant més del previst. Les dades capturades són segures. L'editor s'obrirà en breu.",
+ "description": "Toast shown when the recorder does not acknowledge the stop request within a few seconds"
+ },
+ "copyDebugInfoButton": {
+ "message": "Copiar info de depuració",
+ "description": "Button to copy technical debug info to clipboard for support"
+ },
+ "debugInfoCopiedToast": {
+ "message": "Info de depuració copiada",
+ "description": "Toast shown after debug info is copied"
+ },
+ "getHelpButton": {
+ "message": "Obtenir ajuda",
+ "description": "Side button on error modals that opens a prefilled support form"
+ },
+ "recordingTooShortToast": {
+ "message": "L'enregistrament era massa curt per desar-lo",
+ "description": "Toast shown when a region recording is stopped by navigation but no chunks were saved"
+ },
+ "fastRecorderFailedTitle": {
+ "message": "L'enregistrador ràpid ha fallat",
+ "description": "Title for the modal shown when the fast MP4 recorder output could not be validated"
+ },
+ "fastRecorderFailedDescription": {
+ "message": "La sortida de l'enregistrador ràpid no s'ha pogut validar en aquest dispositiu.\nPots descarregar el fitxer igualment.",
+ "description": "Body text for the fast recorder failure modal"
+ },
+ "downloadAnywayButton": {
+ "message": "Descarrega igualment",
+ "description": "Button to download the recording file despite validation failure"
+ },
+ "cancelButton": {
+ "message": "Cancel\u00b7la",
+ "description": "Generic cancel button label"
}
-}
\ No newline at end of file
+}
diff --git a/src/_locales/de/messages.json b/src/_locales/de/messages.json
index 15f8a49..fd9c5a6 100644
--- a/src/_locales/de/messages.json
+++ b/src/_locales/de/messages.json
@@ -1458,8 +1458,8 @@
"description": "Toast shown when a crashed recording session is auto-recovered on startup"
},
"toastStorageCritical": {
- "message": "Low disk space detected. Recording is stopping to avoid corruption.",
- "description": "Toast shown when available storage drops below the critical threshold during recording"
+ "message": "Wenig Speicherplatz. Aufnahme wird jetzt gespeichert. Alles Aufgenommene ist sicher.",
+ "description": "Toast shown when available storage drops below the critical threshold during recording; reassures that captured data is preserved"
},
"toastStorageLow": {
"message": "Storage is running low. Upload reliability may degrade for long recordings.",
@@ -1472,5 +1472,105 @@
"toastNetworkOffline": {
"message": "Network offline. Upload paused. Screen chunks are saved locally.",
"description": "Toast shown when the browser goes offline during a cloud recording upload"
+ },
+ "longRecordingTitle": {
+ "message": "Lange Aufnahme",
+ "description": "Banner title shown when a recording exceeds the local processing limit but is otherwise successful"
+ },
+ "longRecordingDescription": {
+ "message": "Deine Aufnahme ist vollständig und sicher. Als WebM herunterladen.",
+ "description": "Banner description for long recordings that can be downloaded but not edited locally"
+ },
+ "notAvailableLongRecording": {
+ "message": "Für lange Aufnahmen nicht verfügbar",
+ "description": "Disabled button label for features not available due to recording length"
+ },
+ "notAvailableRecoveryMode": {
+ "message": "Im Wiederherstellungsmodus nicht verfügbar",
+ "description": "Disabled button label for features not available in recovery/fallback mode"
+ },
+ "editTooLongTitle": {
+ "message": "Audiobearbeitung zu lang",
+ "description": "Alert title when an audio mute/mix edit is rejected because the clip exceeds 15 minutes"
+ },
+ "editTooLongDescription": {
+ "message": "Diese Audiobearbeitung wird für Clips über 15 Minuten nicht unterstützt. Dein Original ist unverändert. Versuche, den Clip zuerst zu kürzen.",
+ "description": "Alert body explaining the 15-minute limit and suggesting trimming first"
+ },
+ "editTimeoutTitle": {
+ "message": "Bearbeitung abgelaufen",
+ "description": "Alert title when an edit operation does not complete within the 5-minute watchdog period"
+ },
+ "editTimeoutDescription": {
+ "message": "Die Bearbeitung konnte nicht rechtzeitig abgeschlossen werden. Deine Originalaufnahme ist unverändert. Versuche es erneut oder kürze den Clip zuerst.",
+ "description": "Alert body for the timeout case, prompting retry or shorter clip"
+ },
+ "streamEndedWarningToast": {
+ "message": "Bildschirmfreigabe beendet. Die bisherige Aufnahme ist gespeichert. Beende die Aufnahme, wenn du bereit bist.",
+ "description": "Toast shown when screen share track ends mid-recording. Recording continues; removes false urgency about data loss."
+ },
+ "recoveryModeDescription": {
+ "message": "Es gab ein Verarbeitungsproblem, aber deine Aufnahme ist sicher. Du kannst sie unten herunterladen.",
+ "description": "Recovery mode banner description — reassures user their recording is accessible despite the processing failure"
+ },
+ "editProcessingSafeDescription": {
+ "message": "Bearbeitung wird verarbeitet. Deine Originalaufnahme bleibt unverändert.",
+ "description": "Shown in the editor processing alert when a user-initiated edit is running, to reassure the original is safe"
+ },
+ "editFailedTitle": {
+ "message": "Bearbeitung konnte nicht angewandt werden",
+ "description": "Alert title when an edit operation fails due to an encoding or processing error"
+ },
+ "editFailedDescription": {
+ "message": "Bei der Verarbeitung ist etwas schiefgelaufen. Deine Originalaufnahme ist sicher. Du kannst es erneut versuchen oder sie so herunterladen.",
+ "description": "Alert body for edit failure; explicitly confirms the original recording is untouched"
+ },
+ "videoTrackEndedToast": {
+ "message": "Bildschirmfreigabe beendet. Aufnahme wird jetzt gespeichert. Alles Aufgenommene ist sicher.",
+ "description": "Toast shown when the video track ends mid-recording (e.g. monitor disconnected, screen share revoked)"
+ },
+ "audioTrackEndedToast": {
+ "message": "Audio getrennt. Aufnahme wird jetzt gespeichert. Das bisherige Video ist sicher.",
+ "description": "Toast shown when the audio track ends mid-recording (e.g. mic unplugged, permission revoked)"
+ },
+ "editorRecoveryToast": {
+ "message": "Aufnahme gespeichert. Der Editor konnte nicht geöffnet werden. Klicke auf das Screenity-Symbol, um es erneut zu versuchen.",
+ "description": "Toast shown on the active tab when the post-recording editor tab fails to open"
+ },
+ "stopAckTimeoutToast": {
+ "message": "Das Speichern dauert länger als erwartet. Deine Daten sind sicher. Der Editor wird gleich geöffnet.",
+ "description": "Toast shown when the recorder does not acknowledge the stop request within a few seconds"
+ },
+ "copyDebugInfoButton": {
+ "message": "Debug-Info kopieren",
+ "description": "Button to copy technical debug info to clipboard for support"
+ },
+ "debugInfoCopiedToast": {
+ "message": "Debug-Info kopiert",
+ "description": "Toast shown after debug info is copied"
+ },
+ "getHelpButton": {
+ "message": "Hilfe erhalten",
+ "description": "Side button on error modals that opens a prefilled support form"
+ },
+ "recordingTooShortToast": {
+ "message": "Aufnahme war zu kurz zum Speichern",
+ "description": "Toast shown when a region recording is stopped by navigation but no chunks were saved"
+ },
+ "fastRecorderFailedTitle": {
+ "message": "Schnellaufnahme fehlgeschlagen",
+ "description": "Title for the modal shown when the fast MP4 recorder output could not be validated"
+ },
+ "fastRecorderFailedDescription": {
+ "message": "Die Ausgabe der Schnellaufnahme konnte auf diesem Gerät nicht validiert werden.\nDu kannst die Datei trotzdem herunterladen.",
+ "description": "Body text for the fast recorder failure modal"
+ },
+ "downloadAnywayButton": {
+ "message": "Trotzdem herunterladen",
+ "description": "Button to download the recording file despite validation failure"
+ },
+ "cancelButton": {
+ "message": "Abbrechen",
+ "description": "Generic cancel button label"
}
-}
\ No newline at end of file
+}
diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json
index 44f6e00..c837b55 100644
--- a/src/_locales/en/messages.json
+++ b/src/_locales/en/messages.json
@@ -776,13 +776,45 @@
"description": "Update announcement button for existing users"
},
"streamErrorModalTitle": {
- "message": "Error starting the recording",
+ "message": "Recording stopped",
"description": "Stream error modal title"
},
"streamErrorModalDescription": {
- "message": "Looks like there was an error starting the recording. Restart your browser and try again. If the issue persists, please contact us at [email protected].",
+ "message": "Looks like something went wrong with the recording. Restart your browser and try again. If the issue persists, please contact us at [email protected].",
"description": "Stream error modal description"
},
+ "copyDebugInfoButton": {
+ "message": "Copy debug info",
+ "description": "Button to copy technical debug info to clipboard for support"
+ },
+ "debugInfoCopiedToast": {
+ "message": "Debug info copied to clipboard",
+ "description": "Toast shown after debug info is copied"
+ },
+ "getHelpButton": {
+ "message": "Get help",
+ "description": "Side button on error modals that opens a prefilled support form"
+ },
+ "recordingTooShortToast": {
+ "message": "Recording was too short to save",
+ "description": "Toast shown when a region recording is stopped by navigation but no chunks were saved"
+ },
+ "fastRecorderFailedTitle": {
+ "message": "Fast recorder failed",
+ "description": "Title for the modal shown when the fast MP4 recorder output could not be validated"
+ },
+ "fastRecorderFailedDescription": {
+ "message": "The fast recorder output couldn't be validated on this device.\nYou can download the file anyway.",
+ "description": "Body text for the fast recorder failure modal"
+ },
+ "downloadAnywayButton": {
+ "message": "Download anyway",
+ "description": "Button to download the recording file despite validation failure"
+ },
+ "cancelButton": {
+ "message": "Cancel",
+ "description": "Generic cancel button label"
+ },
"highestQuality": {
"message": "Highest quality",
"description": "Highest quality toggle label in popup"
@@ -820,7 +852,7 @@
"description": "Memory limit reached title"
},
"memoryLimitDescription": {
- "message": "Your device has run out of memory to record, so the recording has stopped automatically. If you'd like to record for longer, you can try lowering the quality of the video, or clearing up some space on your device.",
+ "message": "Your device ran out of storage space, so the recording stopped automatically. Your recording up to that point is safe and you can download it from the editor. To record longer, try lowering the video quality or freeing up space on your device.",
"description": "Memory limit reached description"
},
"understoodButton": {
@@ -903,6 +935,22 @@
"message": "Recovery mode",
"description": "Recovery mode title"
},
+ "longRecordingTitle": {
+ "message": "Long recording",
+ "description": "Banner title shown when a recording exceeds the local processing limit but is otherwise successful"
+ },
+ "longRecordingDescription": {
+ "message": "Your recording is complete and safe. Download as WebM below.",
+ "description": "Banner description for long recordings that can be downloaded but not edited locally"
+ },
+ "notAvailableLongRecording": {
+ "message": "Unavailable for long recordings",
+ "description": "Disabled button label for features not available due to recording length"
+ },
+ "notAvailableRecoveryMode": {
+ "message": "Unavailable in recovery mode",
+ "description": "Disabled button label for features not available in recovery/fallback mode"
+ },
"downloadForTroubleshootingOption": {
"message": "Download data for troubleshooting",
"description": "Download for troubleshooting option"
@@ -1458,8 +1506,8 @@
"description": "Toast shown when a crashed recording session is auto-recovered on startup"
},
"toastStorageCritical": {
- "message": "Low disk space detected. Recording is stopping to avoid corruption.",
- "description": "Toast shown when available storage drops below the critical threshold during recording"
+ "message": "Low disk space. Saving your recording now. Everything captured so far is safe.",
+ "description": "Toast when disk space drops below critical threshold during recording"
},
"toastStorageLow": {
"message": "Storage is running low. Upload reliability may degrade for long recordings.",
@@ -1472,5 +1520,57 @@
"toastNetworkOffline": {
"message": "Network offline. Upload paused. Screen chunks are saved locally.",
"description": "Toast shown when the browser goes offline during a cloud recording upload"
+ },
+ "editTooLongTitle": {
+ "message": "Audio edit too long",
+ "description": "Alert title when an audio mute/mix edit is rejected because the clip exceeds 15 minutes"
+ },
+ "editTooLongDescription": {
+ "message": "This audio edit isn't supported for clips over 15 minutes. Your original is unchanged. Try trimming first, then re-apply the edit.",
+ "description": "Alert body explaining the 15-minute limit for in-browser edits"
+ },
+ "editTimeoutTitle": {
+ "message": "Edit timed out",
+ "description": "Alert title when an edit operation does not complete within the 5-minute watchdog period"
+ },
+ "editTimeoutDescription": {
+ "message": "The edit did not complete in time. Your original recording is unchanged. Try again, or trim the clip first.",
+ "description": "Alert body for edit timeout"
+ },
+ "streamEndedWarningToast": {
+ "message": "Screen sharing stopped. Your recording so far is saved. Stop when you're ready.",
+ "description": "Toast shown when screen share track ends mid-recording. Recording continues; removes false urgency about data loss."
+ },
+ "recoveryModeDescription": {
+ "message": "There was a processing issue, but your recording is safe. You can download it below.",
+ "description": "Recovery mode banner description"
+ },
+ "editProcessingSafeDescription": {
+ "message": "Processing your edit. Your original recording is untouched.",
+ "description": "Shown in the editor processing alert when a user-initiated edit is running, to reassure the original is safe"
+ },
+ "editFailedTitle": {
+ "message": "Edit couldn't be applied",
+ "description": "Alert title when an edit operation fails due to an encoding or processing error"
+ },
+ "editFailedDescription": {
+ "message": "Something went wrong during processing. Your original recording is safe. You can try again or download as-is.",
+ "description": "Alert body for edit failure"
+ },
+ "videoTrackEndedToast": {
+ "message": "Screen sharing stopped. Saving your recording now. Everything captured so far is safe.",
+ "description": "Toast shown when the video track ends mid-recording (e.g. monitor disconnected, screen share revoked)"
+ },
+ "audioTrackEndedToast": {
+ "message": "Audio disconnected. Saving your recording now. The video captured so far is safe.",
+ "description": "Toast shown when the audio track ends mid-recording (e.g. mic unplugged, permission revoked)"
+ },
+ "editorRecoveryToast": {
+ "message": "Your recording is saved. The editor didn't open. Click the Screenity icon to try again.",
+ "description": "Toast shown on the active tab when the post-recording editor tab fails to open"
+ },
+ "stopAckTimeoutToast": {
+ "message": "Saving is taking longer than expected. Your captured data is safe. The editor will open shortly.",
+ "description": "Toast shown when the recorder does not acknowledge the stop request within a few seconds"
}
}
diff --git a/src/_locales/es/messages.json b/src/_locales/es/messages.json
index eb1f8c8..bb89237 100644
--- a/src/_locales/es/messages.json
+++ b/src/_locales/es/messages.json
@@ -1458,8 +1458,8 @@
"description": "Toast shown when a crashed recording session is auto-recovered on startup"
},
"toastStorageCritical": {
- "message": "Low disk space detected. Recording is stopping to avoid corruption.",
- "description": "Toast shown when available storage drops below the critical threshold during recording"
+ "message": "Poco espacio en disco. Guardando tu grabación. Todo lo capturado hasta ahora está seguro.",
+ "description": "Toast shown when available storage drops below the critical threshold during recording; reassures that captured data is preserved"
},
"toastStorageLow": {
"message": "Storage is running low. Upload reliability may degrade for long recordings.",
@@ -1472,5 +1472,105 @@
"toastNetworkOffline": {
"message": "Network offline. Upload paused. Screen chunks are saved locally.",
"description": "Toast shown when the browser goes offline during a cloud recording upload"
+ },
+ "longRecordingTitle": {
+ "message": "Grabación larga",
+ "description": "Banner title shown when a recording exceeds the local processing limit but is otherwise successful"
+ },
+ "longRecordingDescription": {
+ "message": "Tu grabación está completa y segura. Descárgala como WebM abajo.",
+ "description": "Banner description for long recordings that can be downloaded but not edited locally"
+ },
+ "notAvailableLongRecording": {
+ "message": "No disponible para grabaciones largas",
+ "description": "Disabled button label for features not available due to recording length"
+ },
+ "notAvailableRecoveryMode": {
+ "message": "No disponible en modo de recuperación",
+ "description": "Disabled button label for features not available in recovery/fallback mode"
+ },
+ "editTooLongTitle": {
+ "message": "Edición de audio demasiado larga",
+ "description": "Alert title when an audio mute/mix edit is rejected because the clip exceeds 15 minutes"
+ },
+ "editTooLongDescription": {
+ "message": "Esta edición de audio no es compatible con clips de más de 15 minutos. Tu original no se ha modificado. Intenta recortar el clip primero.",
+ "description": "Alert body explaining the 15-minute limit and suggesting trimming first"
+ },
+ "editTimeoutTitle": {
+ "message": "Tiempo de edición agotado",
+ "description": "Alert title when an edit operation does not complete within the 5-minute watchdog period"
+ },
+ "editTimeoutDescription": {
+ "message": "La edición no se completó a tiempo. Tu grabación original no se ha modificado. Inténtalo de nuevo o recorta el clip primero.",
+ "description": "Alert body for the timeout case, prompting retry or shorter clip"
+ },
+ "streamEndedWarningToast": {
+ "message": "La pantalla compartida se detuvo. Tu grabación está guardada. Para cuando quieras.",
+ "description": "Toast shown when screen share track ends mid-recording. Recording continues; removes false urgency about data loss."
+ },
+ "recoveryModeDescription": {
+ "message": "Hubo un problema de procesamiento, pero tu grabación está segura. Puedes descargarla a continuación.",
+ "description": "Recovery mode banner description — reassures user their recording is accessible despite the processing failure"
+ },
+ "editProcessingSafeDescription": {
+ "message": "Procesando tu edición. La grabación original no se ha modificado.",
+ "description": "Shown in the editor processing alert when a user-initiated edit is running, to reassure the original is safe"
+ },
+ "editFailedTitle": {
+ "message": "No se pudo aplicar la edición",
+ "description": "Alert title when an edit operation fails due to an encoding or processing error"
+ },
+ "editFailedDescription": {
+ "message": "Algo salió mal durante el procesamiento. Tu grabación original está segura. Puedes intentarlo de nuevo o descargarla tal cual.",
+ "description": "Alert body for edit failure; explicitly confirms the original recording is untouched"
+ },
+ "videoTrackEndedToast": {
+ "message": "La pantalla compartida se detuvo. Guardando tu grabación. Todo lo capturado hasta ahora está seguro.",
+ "description": "Toast shown when the video track ends mid-recording (e.g. monitor disconnected, screen share revoked)"
+ },
+ "audioTrackEndedToast": {
+ "message": "Audio desconectado. Guardando tu grabación. El video capturado hasta ahora está seguro.",
+ "description": "Toast shown when the audio track ends mid-recording (e.g. mic unplugged, permission revoked)"
+ },
+ "editorRecoveryToast": {
+ "message": "Tu grabación está guardada. El editor no se abrió. Haz clic en el ícono de Screenity para intentarlo de nuevo.",
+ "description": "Toast shown on the active tab when the post-recording editor tab fails to open"
+ },
+ "stopAckTimeoutToast": {
+ "message": "El guardado está tardando más de lo esperado. Tus datos están seguros. El editor se abrirá pronto.",
+ "description": "Toast shown when the recorder does not acknowledge the stop request within a few seconds"
+ },
+ "copyDebugInfoButton": {
+ "message": "Copiar info de depuración",
+ "description": "Button to copy technical debug info to clipboard for support"
+ },
+ "debugInfoCopiedToast": {
+ "message": "Info de depuración copiada",
+ "description": "Toast shown after debug info is copied"
+ },
+ "getHelpButton": {
+ "message": "Obtener ayuda",
+ "description": "Side button on error modals that opens a prefilled support form"
+ },
+ "recordingTooShortToast": {
+ "message": "La grabación fue demasiado corta para guardarla",
+ "description": "Toast shown when a region recording is stopped by navigation but no chunks were saved"
+ },
+ "fastRecorderFailedTitle": {
+ "message": "El grabador r\u00e1pido fall\u00f3",
+ "description": "Title for the modal shown when the fast MP4 recorder output could not be validated"
+ },
+ "fastRecorderFailedDescription": {
+ "message": "La salida del grabador r\u00e1pido no se pudo validar en este dispositivo.\nPuedes descargar el archivo de todas formas.",
+ "description": "Body text for the fast recorder failure modal"
+ },
+ "downloadAnywayButton": {
+ "message": "Descargar de todas formas",
+ "description": "Button to download the recording file despite validation failure"
+ },
+ "cancelButton": {
+ "message": "Cancelar",
+ "description": "Generic cancel button label"
}
-}
\ No newline at end of file
+}
diff --git a/src/_locales/fr/messages.json b/src/_locales/fr/messages.json
index e52676e..ebba780 100644
--- a/src/_locales/fr/messages.json
+++ b/src/_locales/fr/messages.json
@@ -1458,8 +1458,8 @@
"description": "Toast shown when a crashed recording session is auto-recovered on startup"
},
"toastStorageCritical": {
- "message": "Low disk space detected. Recording is stopping to avoid corruption.",
- "description": "Toast shown when available storage drops below the critical threshold during recording"
+ "message": "Espace disque faible. Sauvegarde de l'enregistrement en cours. Tout ce qui a été capturé est en sécurité.",
+ "description": "Toast shown when available storage drops below the critical threshold during recording; reassures that captured data is preserved"
},
"toastStorageLow": {
"message": "Storage is running low. Upload reliability may degrade for long recordings.",
@@ -1472,5 +1472,105 @@
"toastNetworkOffline": {
"message": "Network offline. Upload paused. Screen chunks are saved locally.",
"description": "Toast shown when the browser goes offline during a cloud recording upload"
+ },
+ "longRecordingTitle": {
+ "message": "Enregistrement long",
+ "description": "Banner title shown when a recording exceeds the local processing limit but is otherwise successful"
+ },
+ "longRecordingDescription": {
+ "message": "Votre enregistrement est complet et en sécurité. Téléchargez en WebM ci-dessous.",
+ "description": "Banner description for long recordings that can be downloaded but not edited locally"
+ },
+ "notAvailableLongRecording": {
+ "message": "Indisponible pour les longs enregistrements",
+ "description": "Disabled button label for features not available due to recording length"
+ },
+ "notAvailableRecoveryMode": {
+ "message": "Indisponible en mode de récupération",
+ "description": "Disabled button label for features not available in recovery/fallback mode"
+ },
+ "editTooLongTitle": {
+ "message": "Édition audio trop longue",
+ "description": "Alert title when an audio mute/mix edit is rejected because the clip exceeds 15 minutes"
+ },
+ "editTooLongDescription": {
+ "message": "Cette édition audio n'est pas prise en charge pour les clips de plus de 15 minutes. Votre original n'est pas modifié. Essayez d'abord de rogner le clip.",
+ "description": "Alert body explaining the 15-minute limit and suggesting trimming first"
+ },
+ "editTimeoutTitle": {
+ "message": "Expiration de l'édition",
+ "description": "Alert title when an edit operation does not complete within the 5-minute watchdog period"
+ },
+ "editTimeoutDescription": {
+ "message": "L'édition n'a pas pu être terminée à temps. Votre enregistrement original n'est pas modifié. Réessayez ou rognez le clip d'abord.",
+ "description": "Alert body for the timeout case, prompting retry or shorter clip"
+ },
+ "streamEndedWarningToast": {
+ "message": "Le partage d'écran s'est arrêté. Votre enregistrement est sauvegardé. Arrêtez quand vous êtes prêt.",
+ "description": "Toast shown when screen share track ends mid-recording. Recording continues; removes false urgency about data loss."
+ },
+ "recoveryModeDescription": {
+ "message": "Un problème de traitement est survenu, mais votre enregistrement est en sécurité. Vous pouvez le télécharger ci-dessous.",
+ "description": "Recovery mode banner description — reassures user their recording is accessible despite the processing failure"
+ },
+ "editProcessingSafeDescription": {
+ "message": "Traitement de votre modification en cours. L'enregistrement original n'est pas modifié.",
+ "description": "Shown in the editor processing alert when a user-initiated edit is running, to reassure the original is safe"
+ },
+ "editFailedTitle": {
+ "message": "La modification n'a pas pu être appliquée",
+ "description": "Alert title when an edit operation fails due to an encoding or processing error"
+ },
+ "editFailedDescription": {
+ "message": "Une erreur est survenue pendant le traitement. Votre enregistrement original est en sécurité. Vous pouvez réessayer ou le télécharger tel quel.",
+ "description": "Alert body for edit failure; explicitly confirms the original recording is untouched"
+ },
+ "videoTrackEndedToast": {
+ "message": "Le partage d'écran s'est arrêté. Sauvegarde de l'enregistrement en cours. Tout ce qui a été capturé est en sécurité.",
+ "description": "Toast shown when the video track ends mid-recording (e.g. monitor disconnected, screen share revoked)"
+ },
+ "audioTrackEndedToast": {
+ "message": "Audio déconnecté. Sauvegarde de l'enregistrement en cours. La vidéo capturée est en sécurité.",
+ "description": "Toast shown when the audio track ends mid-recording (e.g. mic unplugged, permission revoked)"
+ },
+ "editorRecoveryToast": {
+ "message": "Votre enregistrement est sauvegardé. L'éditeur ne s'est pas ouvert. Cliquez sur l'icône Screenity pour réessayer.",
+ "description": "Toast shown on the active tab when the post-recording editor tab fails to open"
+ },
+ "stopAckTimeoutToast": {
+ "message": "La sauvegarde prend plus de temps que prévu. Vos données sont en sécurité. L'éditeur s'ouvrira bientôt.",
+ "description": "Toast shown when the recorder does not acknowledge the stop request within a few seconds"
+ },
+ "copyDebugInfoButton": {
+ "message": "Copier les infos de débogage",
+ "description": "Button to copy technical debug info to clipboard for support"
+ },
+ "debugInfoCopiedToast": {
+ "message": "Infos de débogage copiées",
+ "description": "Toast shown after debug info is copied"
+ },
+ "getHelpButton": {
+ "message": "Obtenir de l'aide",
+ "description": "Side button on error modals that opens a prefilled support form"
+ },
+ "recordingTooShortToast": {
+ "message": "L'enregistrement était trop court pour être sauvegardé",
+ "description": "Toast shown when a region recording is stopped by navigation but no chunks were saved"
+ },
+ "fastRecorderFailedTitle": {
+ "message": "L'enregistreur rapide a \u00e9chou\u00e9",
+ "description": "Title for the modal shown when the fast MP4 recorder output could not be validated"
+ },
+ "fastRecorderFailedDescription": {
+ "message": "La sortie de l'enregistreur rapide n'a pas pu \u00eatre valid\u00e9e sur cet appareil.\nVous pouvez quand m\u00eame t\u00e9l\u00e9charger le fichier.",
+ "description": "Body text for the fast recorder failure modal"
+ },
+ "downloadAnywayButton": {
+ "message": "T\u00e9l\u00e9charger quand m\u00eame",
+ "description": "Button to download the recording file despite validation failure"
+ },
+ "cancelButton": {
+ "message": "Annuler",
+ "description": "Generic cancel button label"
}
-}
\ No newline at end of file
+}
diff --git a/src/_locales/hi/messages.json b/src/_locales/hi/messages.json
index 75a2c90..a131d03 100644
--- a/src/_locales/hi/messages.json
+++ b/src/_locales/hi/messages.json
@@ -1458,8 +1458,8 @@
"description": "Toast shown when a crashed recording session is auto-recovered on startup"
},
"toastStorageCritical": {
- "message": "Low disk space detected. Recording is stopping to avoid corruption.",
- "description": "Toast shown when available storage drops below the critical threshold during recording"
+ "message": "डिस्क में कम जगह। आपकी रिकॉर्डिंग सहेजी जा रही है। अब तक कैप्चर किया गया सब कुछ सुरक्षित है।",
+ "description": "Toast shown when available storage drops below the critical threshold during recording; reassures that captured data is preserved"
},
"toastStorageLow": {
"message": "Storage is running low. Upload reliability may degrade for long recordings.",
@@ -1472,5 +1472,105 @@
"toastNetworkOffline": {
"message": "Network offline. Upload paused. Screen chunks are saved locally.",
"description": "Toast shown when the browser goes offline during a cloud recording upload"
+ },
+ "longRecordingTitle": {
+ "message": "लंबी रिकॉर्डिंग",
+ "description": "Banner title shown when a recording exceeds the local processing limit but is otherwise successful"
+ },
+ "longRecordingDescription": {
+ "message": "आपकी रिकॉर्डिंग पूर्ण और सुरक्षित है। नीचे WebM के रूप में डाउनलोड करें।",
+ "description": "Banner description for long recordings that can be downloaded but not edited locally"
+ },
+ "notAvailableLongRecording": {
+ "message": "लंबी रिकॉर्डिंग के लिए अनुपलब्ध",
+ "description": "Disabled button label for features not available due to recording length"
+ },
+ "notAvailableRecoveryMode": {
+ "message": "पुनर्प्राप्ति मोड में अनुपलब्ध",
+ "description": "Disabled button label for features not available in recovery/fallback mode"
+ },
+ "editTooLongTitle": {
+ "message": "ऑडियो संपादन बहुत लंबा",
+ "description": "Alert title when an audio mute/mix edit is rejected because the clip exceeds 15 minutes"
+ },
+ "editTooLongDescription": {
+ "message": "यह ऑडियो संपादन 15 मिनट से अधिक के क्लिप के लिए समर्थित नहीं है। आपका मूल अपरिवर्तित है। पहले क्लिप को ट्रिम करने का प्रयास करें।",
+ "description": "Alert body explaining the 15-minute limit and suggesting trimming first"
+ },
+ "editTimeoutTitle": {
+ "message": "संपादन का समय समाप्त",
+ "description": "Alert title when an edit operation does not complete within the 5-minute watchdog period"
+ },
+ "editTimeoutDescription": {
+ "message": "संपादन समय पर पूरा नहीं हुआ। आपकी मूल रिकॉर्डिंग अपरिवर्तित है। फिर से प्रयास करें या पहले क्लिप ट्रिम करें।",
+ "description": "Alert body for the timeout case, prompting retry or shorter clip"
+ },
+ "streamEndedWarningToast": {
+ "message": "स्क्रीन शेयरिंग बंद हो गई। आपकी रिकॉर्डिंग सहेजी गई है। जब तैयार हों तब रोकें।",
+ "description": "Toast shown when screen share track ends mid-recording. Recording continues; removes false urgency about data loss."
+ },
+ "recoveryModeDescription": {
+ "message": "प्रोसेसिंग में कोई समस्या थी, लेकिन आपकी रिकॉर्डिंग सुरक्षित है। आप इसे नीचे डाउनलोड कर सकते हैं।",
+ "description": "Recovery mode banner description — reassures user their recording is accessible despite the processing failure"
+ },
+ "editProcessingSafeDescription": {
+ "message": "आपका संपादन प्रोसेस हो रहा है। आपकी मूल रिकॉर्डिंग अपरिवर्तित है।",
+ "description": "Shown in the editor processing alert when a user-initiated edit is running, to reassure the original is safe"
+ },
+ "editFailedTitle": {
+ "message": "संपादन लागू नहीं हो सका",
+ "description": "Alert title when an edit operation fails due to an encoding or processing error"
+ },
+ "editFailedDescription": {
+ "message": "प्रोसेसिंग के दौरान कुछ गलत हो गया। आपकी मूल रिकॉर्डिंग सुरक्षित है। आप फिर से कोशिश कर सकते हैं या इसे वैसे ही डाउनलोड कर सकते हैं।",
+ "description": "Alert body for edit failure; explicitly confirms the original recording is untouched"
+ },
+ "videoTrackEndedToast": {
+ "message": "स्क्रीन शेयरिंग बंद हो गई। आपकी रिकॉर्डिंग सहेजी जा रही है। अब तक कैप्चर किया गया सब कुछ सुरक्षित है।",
+ "description": "Toast shown when the video track ends mid-recording (e.g. monitor disconnected, screen share revoked)"
+ },
+ "audioTrackEndedToast": {
+ "message": "ऑडियो डिस्कनेक्ट हो गया। आपकी रिकॉर्डिंग सहेजी जा रही है। अब तक कैप्चर किया गया वीडियो सुरक्षित है।",
+ "description": "Toast shown when the audio track ends mid-recording (e.g. mic unplugged, permission revoked)"
+ },
+ "editorRecoveryToast": {
+ "message": "आपकी रिकॉर्डिंग सहेजी गई है। एडिटर नहीं खुला। फिर से कोशिश करने के लिए Screenity आइकन पर क्लिक करें।",
+ "description": "Toast shown on the active tab when the post-recording editor tab fails to open"
+ },
+ "stopAckTimeoutToast": {
+ "message": "सहेजने में अपेक्षा से अधिक समय लग रहा है। आपका डेटा सुरक्षित है। एडिटर जल्द खुलेगा।",
+ "description": "Toast shown when the recorder does not acknowledge the stop request within a few seconds"
+ },
+ "copyDebugInfoButton": {
+ "message": "डीबग जानकारी कॉपी करें",
+ "description": "Button to copy technical debug info to clipboard for support"
+ },
+ "debugInfoCopiedToast": {
+ "message": "डीबग जानकारी कॉपी हो गई",
+ "description": "Toast shown after debug info is copied"
+ },
+ "getHelpButton": {
+ "message": "सहायता प्राप्त करें",
+ "description": "Side button on error modals that opens a prefilled support form"
+ },
+ "recordingTooShortToast": {
+ "message": "रिकॉर्डिंग सेव करने के लिए बहुत छोटी थी",
+ "description": "Toast shown when a region recording is stopped by navigation but no chunks were saved"
+ },
+ "fastRecorderFailedTitle": {
+ "message": "तेज़ रिकॉर्डर विफल हुआ",
+ "description": "Title for the modal shown when the fast MP4 recorder output could not be validated"
+ },
+ "fastRecorderFailedDescription": {
+ "message": "इस डिवाइस पर तेज़ रिकॉर्डर का आउटपुट सत्यापित नहीं हो सका।\nआप फिर भी फ़ाइल डाउनलोड कर सकते हैं।",
+ "description": "Body text for the fast recorder failure modal"
+ },
+ "downloadAnywayButton": {
+ "message": "फिर भी डाउनलोड करें",
+ "description": "Button to download the recording file despite validation failure"
+ },
+ "cancelButton": {
+ "message": "रद्द करें",
+ "description": "Generic cancel button label"
}
-}
\ No newline at end of file
+}
diff --git a/src/_locales/id/messages.json b/src/_locales/id/messages.json
index 841f9c2..9c6de6a 100644
--- a/src/_locales/id/messages.json
+++ b/src/_locales/id/messages.json
@@ -1458,8 +1458,8 @@
"description": "Toast shown when a crashed recording session is auto-recovered on startup"
},
"toastStorageCritical": {
- "message": "Low disk space detected. Recording is stopping to avoid corruption.",
- "description": "Toast shown when available storage drops below the critical threshold during recording"
+ "message": "Ruang disk rendah. Menyimpan rekaman Anda. Semua yang direkam sejauh ini aman.",
+ "description": "Toast shown when available storage drops below the critical threshold during recording; reassures that captured data is preserved"
},
"toastStorageLow": {
"message": "Storage is running low. Upload reliability may degrade for long recordings.",
@@ -1472,5 +1472,105 @@
"toastNetworkOffline": {
"message": "Network offline. Upload paused. Screen chunks are saved locally.",
"description": "Toast shown when the browser goes offline during a cloud recording upload"
+ },
+ "longRecordingTitle": {
+ "message": "Rekaman panjang",
+ "description": "Banner title shown when a recording exceeds the local processing limit but is otherwise successful"
+ },
+ "longRecordingDescription": {
+ "message": "Rekaman Anda lengkap dan aman. Unduh sebagai WebM di bawah.",
+ "description": "Banner description for long recordings that can be downloaded but not edited locally"
+ },
+ "notAvailableLongRecording": {
+ "message": "Tidak tersedia untuk rekaman panjang",
+ "description": "Disabled button label for features not available due to recording length"
+ },
+ "notAvailableRecoveryMode": {
+ "message": "Tidak tersedia dalam mode pemulihan",
+ "description": "Disabled button label for features not available in recovery/fallback mode"
+ },
+ "editTooLongTitle": {
+ "message": "Pengeditan audio terlalu panjang",
+ "description": "Alert title when an audio mute/mix edit is rejected because the clip exceeds 15 minutes"
+ },
+ "editTooLongDescription": {
+ "message": "Pengeditan audio ini tidak didukung untuk klip lebih dari 15 menit. File asli Anda tidak berubah. Coba potong klip terlebih dahulu.",
+ "description": "Alert body explaining the 15-minute limit and suggesting trimming first"
+ },
+ "editTimeoutTitle": {
+ "message": "Pengeditan habis waktu",
+ "description": "Alert title when an edit operation does not complete within the 5-minute watchdog period"
+ },
+ "editTimeoutDescription": {
+ "message": "Pengeditan tidak selesai tepat waktu. Rekaman asli Anda tidak berubah. Coba lagi atau potong klip terlebih dahulu.",
+ "description": "Alert body for the timeout case, prompting retry or shorter clip"
+ },
+ "streamEndedWarningToast": {
+ "message": "Berbagi layar berhenti. Rekaman Anda tersimpan. Hentikan saat Anda siap.",
+ "description": "Toast shown when screen share track ends mid-recording. Recording continues; removes false urgency about data loss."
+ },
+ "recoveryModeDescription": {
+ "message": "Terjadi masalah pemrosesan, tetapi rekaman Anda aman. Anda dapat mengunduhnya di bawah.",
+ "description": "Recovery mode banner description — reassures user their recording is accessible despite the processing failure"
+ },
+ "editProcessingSafeDescription": {
+ "message": "Memproses pengeditan Anda. Rekaman asli tidak berubah.",
+ "description": "Shown in the editor processing alert when a user-initiated edit is running, to reassure the original is safe"
+ },
+ "editFailedTitle": {
+ "message": "Pengeditan tidak dapat diterapkan",
+ "description": "Alert title when an edit operation fails due to an encoding or processing error"
+ },
+ "editFailedDescription": {
+ "message": "Terjadi kesalahan saat pemrosesan. Rekaman asli Anda aman. Anda dapat mencoba lagi atau mengunduhnya apa adanya.",
+ "description": "Alert body for edit failure; explicitly confirms the original recording is untouched"
+ },
+ "videoTrackEndedToast": {
+ "message": "Berbagi layar berhenti. Menyimpan rekaman Anda. Semua yang direkam sejauh ini aman.",
+ "description": "Toast shown when the video track ends mid-recording (e.g. monitor disconnected, screen share revoked)"
+ },
+ "audioTrackEndedToast": {
+ "message": "Audio terputus. Menyimpan rekaman Anda. Video yang direkam sejauh ini aman.",
+ "description": "Toast shown when the audio track ends mid-recording (e.g. mic unplugged, permission revoked)"
+ },
+ "editorRecoveryToast": {
+ "message": "Rekaman Anda tersimpan. Editor tidak terbuka. Klik ikon Screenity untuk mencoba lagi.",
+ "description": "Toast shown on the active tab when the post-recording editor tab fails to open"
+ },
+ "stopAckTimeoutToast": {
+ "message": "Penyimpanan memakan waktu lebih lama dari yang diharapkan. Data Anda aman. Editor akan segera terbuka.",
+ "description": "Toast shown when the recorder does not acknowledge the stop request within a few seconds"
+ },
+ "copyDebugInfoButton": {
+ "message": "Salin info debug",
+ "description": "Button to copy technical debug info to clipboard for support"
+ },
+ "debugInfoCopiedToast": {
+ "message": "Info debug disalin",
+ "description": "Toast shown after debug info is copied"
+ },
+ "getHelpButton": {
+ "message": "Dapatkan bantuan",
+ "description": "Side button on error modals that opens a prefilled support form"
+ },
+ "recordingTooShortToast": {
+ "message": "Rekaman terlalu singkat untuk disimpan",
+ "description": "Toast shown when a region recording is stopped by navigation but no chunks were saved"
+ },
+ "fastRecorderFailedTitle": {
+ "message": "Perekam cepat gagal",
+ "description": "Title for the modal shown when the fast MP4 recorder output could not be validated"
+ },
+ "fastRecorderFailedDescription": {
+ "message": "Output perekam cepat tidak dapat divalidasi di perangkat ini.\nAnda tetap dapat mengunduh filenya.",
+ "description": "Body text for the fast recorder failure modal"
+ },
+ "downloadAnywayButton": {
+ "message": "Unduh saja",
+ "description": "Button to download the recording file despite validation failure"
+ },
+ "cancelButton": {
+ "message": "Batal",
+ "description": "Generic cancel button label"
}
-}
\ No newline at end of file
+}
diff --git a/src/_locales/it/messages.json b/src/_locales/it/messages.json
index 7b72f87..e8f0c8a 100644
--- a/src/_locales/it/messages.json
+++ b/src/_locales/it/messages.json
@@ -1442,8 +1442,8 @@
"description": "Toast shown when a crashed recording session is auto-recovered on startup"
},
"toastStorageCritical": {
- "message": "Low disk space detected. Recording is stopping to avoid corruption.",
- "description": "Toast shown when available storage drops below the critical threshold during recording"
+ "message": "Poco spazio su disco. Salvataggio della registrazione in corso. Tutto ciò che è stato catturato è al sicuro.",
+ "description": "Toast shown when available storage drops below the critical threshold during recording; reassures that captured data is preserved"
},
"toastStorageLow": {
"message": "Storage is running low. Upload reliability may degrade for long recordings.",
@@ -1456,5 +1456,105 @@
"toastNetworkOffline": {
"message": "Network offline. Upload paused. Screen chunks are saved locally.",
"description": "Toast shown when the browser goes offline during a cloud recording upload"
+ },
+ "longRecordingTitle": {
+ "message": "Registrazione lunga",
+ "description": "Banner title shown when a recording exceeds the local processing limit but is otherwise successful"
+ },
+ "longRecordingDescription": {
+ "message": "La registrazione è completa e al sicuro. Scaricala in formato WebM qui sotto.",
+ "description": "Banner description for long recordings that can be downloaded but not edited locally"
+ },
+ "notAvailableLongRecording": {
+ "message": "Non disponibile per registrazioni lunghe",
+ "description": "Disabled button label for features not available due to recording length"
+ },
+ "notAvailableRecoveryMode": {
+ "message": "Non disponibile in modalità di recupero",
+ "description": "Disabled button label for features not available in recovery/fallback mode"
+ },
+ "editTooLongTitle": {
+ "message": "Modifica audio troppo lunga",
+ "description": "Alert title when an audio mute/mix edit is rejected because the clip exceeds 15 minutes"
+ },
+ "editTooLongDescription": {
+ "message": "Questa modifica audio non è supportata per clip oltre 15 minuti. L'originale non è stato modificato. Prova prima a tagliare il clip.",
+ "description": "Alert body explaining the 15-minute limit and suggesting trimming first"
+ },
+ "editTimeoutTitle": {
+ "message": "Modifica scaduta",
+ "description": "Alert title when an edit operation does not complete within the 5-minute watchdog period"
+ },
+ "editTimeoutDescription": {
+ "message": "La modifica non è stata completata in tempo. La registrazione originale non è stata modificata. Riprova o taglia il clip prima.",
+ "description": "Alert body for the timeout case, prompting retry or shorter clip"
+ },
+ "streamEndedWarningToast": {
+ "message": "La condivisione dello schermo si è interrotta. La registrazione è stata salvata. Interrompi quando sei pronto.",
+ "description": "Toast shown when screen share track ends mid-recording. Recording continues; removes false urgency about data loss."
+ },
+ "recoveryModeDescription": {
+ "message": "Si è verificato un problema di elaborazione, ma la registrazione è al sicuro. Puoi scaricarla qui sotto.",
+ "description": "Recovery mode banner description — reassures user their recording is accessible despite the processing failure"
+ },
+ "editProcessingSafeDescription": {
+ "message": "Elaborazione della modifica in corso. La registrazione originale non è stata modificata.",
+ "description": "Shown in the editor processing alert when a user-initiated edit is running, to reassure the original is safe"
+ },
+ "editFailedTitle": {
+ "message": "Impossibile applicare la modifica",
+ "description": "Alert title when an edit operation fails due to an encoding or processing error"
+ },
+ "editFailedDescription": {
+ "message": "Qualcosa è andato storto durante l'elaborazione. La registrazione originale è al sicuro. Puoi riprovare o scaricarla così com'è.",
+ "description": "Alert body for edit failure; explicitly confirms the original recording is untouched"
+ },
+ "videoTrackEndedToast": {
+ "message": "La condivisione dello schermo si è interrotta. Salvataggio della registrazione in corso. Tutto ciò che è stato catturato è al sicuro.",
+ "description": "Toast shown when the video track ends mid-recording (e.g. monitor disconnected, screen share revoked)"
+ },
+ "audioTrackEndedToast": {
+ "message": "Audio disconnesso. Salvataggio della registrazione in corso. Il video catturato è al sicuro.",
+ "description": "Toast shown when the audio track ends mid-recording (e.g. mic unplugged, permission revoked)"
+ },
+ "editorRecoveryToast": {
+ "message": "La registrazione è stata salvata. L'editor non si è aperto. Clicca sull'icona di Screenity per riprovare.",
+ "description": "Toast shown on the active tab when the post-recording editor tab fails to open"
+ },
+ "stopAckTimeoutToast": {
+ "message": "Il salvataggio sta richiedendo più tempo del previsto. I tuoi dati sono al sicuro. L'editor si aprirà a breve.",
+ "description": "Toast shown when the recorder does not acknowledge the stop request within a few seconds"
+ },
+ "copyDebugInfoButton": {
+ "message": "Copia info di debug",
+ "description": "Button to copy technical debug info to clipboard for support"
+ },
+ "debugInfoCopiedToast": {
+ "message": "Info di debug copiate",
+ "description": "Toast shown after debug info is copied"
+ },
+ "getHelpButton": {
+ "message": "Ottieni aiuto",
+ "description": "Side button on error modals that opens a prefilled support form"
+ },
+ "recordingTooShortToast": {
+ "message": "La registrazione era troppo breve per essere salvata",
+ "description": "Toast shown when a region recording is stopped by navigation but no chunks were saved"
+ },
+ "fastRecorderFailedTitle": {
+ "message": "Registratore veloce non riuscito",
+ "description": "Title for the modal shown when the fast MP4 recorder output could not be validated"
+ },
+ "fastRecorderFailedDescription": {
+ "message": "L'output del registratore veloce non ha potuto essere convalidato su questo dispositivo.\nPuoi comunque scaricare il file.",
+ "description": "Body text for the fast recorder failure modal"
+ },
+ "downloadAnywayButton": {
+ "message": "Scarica comunque",
+ "description": "Button to download the recording file despite validation failure"
+ },
+ "cancelButton": {
+ "message": "Annulla",
+ "description": "Generic cancel button label"
}
-}
\ No newline at end of file
+}
diff --git a/src/_locales/ko/messages.json b/src/_locales/ko/messages.json
index c35e5ac..7b5f214 100644
--- a/src/_locales/ko/messages.json
+++ b/src/_locales/ko/messages.json
@@ -1458,8 +1458,8 @@
"description": "Toast shown when a crashed recording session is auto-recovered on startup"
},
"toastStorageCritical": {
- "message": "Low disk space detected. Recording is stopping to avoid corruption.",
- "description": "Toast shown when available storage drops below the critical threshold during recording"
+ "message": "디스크 공간이 부족합니다. 녹화를 저장하고 있어요. 지금까지 캡처된 내용은 안전합니다.",
+ "description": "Toast shown when available storage drops below the critical threshold during recording; reassures that captured data is preserved"
},
"toastStorageLow": {
"message": "Storage is running low. Upload reliability may degrade for long recordings.",
@@ -1472,5 +1472,105 @@
"toastNetworkOffline": {
"message": "Network offline. Upload paused. Screen chunks are saved locally.",
"description": "Toast shown when the browser goes offline during a cloud recording upload"
+ },
+ "longRecordingTitle": {
+ "message": "긴 녹화",
+ "description": "Banner title shown when a recording exceeds the local processing limit but is otherwise successful"
+ },
+ "longRecordingDescription": {
+ "message": "녹화가 완료되었고 안전합니다. 아래에서 WebM으로 다운로드하세요.",
+ "description": "Banner description for long recordings that can be downloaded but not edited locally"
+ },
+ "notAvailableLongRecording": {
+ "message": "긴 녹화에는 사용할 수 없어요",
+ "description": "Disabled button label for features not available due to recording length"
+ },
+ "notAvailableRecoveryMode": {
+ "message": "복구 모드에서 사용할 수 없어요",
+ "description": "Disabled button label for features not available in recovery/fallback mode"
+ },
+ "editTooLongTitle": {
+ "message": "오디오 편집이 너무 깁니다",
+ "description": "Alert title when an audio mute/mix edit is rejected because the clip exceeds 15 minutes"
+ },
+ "editTooLongDescription": {
+ "message": "이 오디오 편집은 15분이 넘는 클립에는 지원되지 않습니다. 원본은 변경되지 않았습니다. 먼저 클립을 다듬어 보세요.",
+ "description": "Alert body explaining the 15-minute limit and suggesting trimming first"
+ },
+ "editTimeoutTitle": {
+ "message": "편집 시간이 초과되었습니다",
+ "description": "Alert title when an edit operation does not complete within the 5-minute watchdog period"
+ },
+ "editTimeoutDescription": {
+ "message": "편집이 제시간에 완료되지 않았습니다. 원본 녹화는 변경되지 않았습니다. 다시 시도하거나 먼저 클립을 다듬어 보세요.",
+ "description": "Alert body for the timeout case, prompting retry or shorter clip"
+ },
+ "streamEndedWarningToast": {
+ "message": "화면 공유가 중단되었어요. 녹화는 저장되었습니다. 준비되면 중지하세요.",
+ "description": "Toast shown when screen share track ends mid-recording. Recording continues; removes false urgency about data loss."
+ },
+ "recoveryModeDescription": {
+ "message": "처리 중 문제가 있었지만 녹화는 안전해요. 아래에서 다운로드할 수 있습니다.",
+ "description": "Recovery mode banner description — reassures user their recording is accessible despite the processing failure"
+ },
+ "editProcessingSafeDescription": {
+ "message": "편집을 처리하고 있어요. 원본 녹화는 변경되지 않았습니다.",
+ "description": "Shown in the editor processing alert when a user-initiated edit is running, to reassure the original is safe"
+ },
+ "editFailedTitle": {
+ "message": "편집을 적용할 수 없어요",
+ "description": "Alert title when an edit operation fails due to an encoding or processing error"
+ },
+ "editFailedDescription": {
+ "message": "처리 중 문제가 발생했어요. 원본 녹화는 안전합니다. 다시 시도하거나 그대로 다운로드할 수 있어요.",
+ "description": "Alert body for edit failure; explicitly confirms the original recording is untouched"
+ },
+ "videoTrackEndedToast": {
+ "message": "화면 공유가 중단되었어요. 녹화를 저장하고 있습니다. 지금까지 캡처된 내용은 안전합니다.",
+ "description": "Toast shown when the video track ends mid-recording (e.g. monitor disconnected, screen share revoked)"
+ },
+ "audioTrackEndedToast": {
+ "message": "오디오가 연결 해제되었어요. 녹화를 저장하고 있습니다. 지금까지 캡처된 영상은 안전합니다.",
+ "description": "Toast shown when the audio track ends mid-recording (e.g. mic unplugged, permission revoked)"
+ },
+ "editorRecoveryToast": {
+ "message": "녹화가 저장되었어요. 편집기가 열리지 않았습니다. Screenity 아이콘을 클릭해서 다시 시도하세요.",
+ "description": "Toast shown on the active tab when the post-recording editor tab fails to open"
+ },
+ "stopAckTimeoutToast": {
+ "message": "저장이 예상보다 오래 걸리고 있어요. 데이터는 안전합니다. 편집기가 곧 열릴 거예요.",
+ "description": "Toast shown when the recorder does not acknowledge the stop request within a few seconds"
+ },
+ "copyDebugInfoButton": {
+ "message": "디버그 정보 복사",
+ "description": "Button to copy technical debug info to clipboard for support"
+ },
+ "debugInfoCopiedToast": {
+ "message": "디버그 정보가 복사되었어요",
+ "description": "Toast shown after debug info is copied"
+ },
+ "getHelpButton": {
+ "message": "도움 받기",
+ "description": "Side button on error modals that opens a prefilled support form"
+ },
+ "recordingTooShortToast": {
+ "message": "녹화 시간이 너무 짧아 저장할 수 없습니다",
+ "description": "Toast shown when a region recording is stopped by navigation but no chunks were saved"
+ },
+ "fastRecorderFailedTitle": {
+ "message": "빠른 녹화기 실패",
+ "description": "Title for the modal shown when the fast MP4 recorder output could not be validated"
+ },
+ "fastRecorderFailedDescription": {
+ "message": "이 기기에서 빠른 녹화기 출력을 검증할 수 없습니다.\n파일을 그대로 다운로드할 수 있습니다.",
+ "description": "Body text for the fast recorder failure modal"
+ },
+ "downloadAnywayButton": {
+ "message": "그래도 다운로드",
+ "description": "Button to download the recording file despite validation failure"
+ },
+ "cancelButton": {
+ "message": "취소",
+ "description": "Generic cancel button label"
}
-}
\ No newline at end of file
+}
diff --git a/src/_locales/pl/messages.json b/src/_locales/pl/messages.json
index 068c5e0..54c7597 100644
--- a/src/_locales/pl/messages.json
+++ b/src/_locales/pl/messages.json
@@ -1458,8 +1458,8 @@
"description": "Toast shown when a crashed recording session is auto-recovered on startup"
},
"toastStorageCritical": {
- "message": "Low disk space detected. Recording is stopping to avoid corruption.",
- "description": "Toast shown when available storage drops below the critical threshold during recording"
+ "message": "Mało miejsca na dysku. Zapisywanie nagrania. Wszystko, co zostało przechwycone, jest bezpieczne.",
+ "description": "Toast shown when available storage drops below the critical threshold during recording; reassures that captured data is preserved"
},
"toastStorageLow": {
"message": "Storage is running low. Upload reliability may degrade for long recordings.",
@@ -1472,5 +1472,105 @@
"toastNetworkOffline": {
"message": "Network offline. Upload paused. Screen chunks are saved locally.",
"description": "Toast shown when the browser goes offline during a cloud recording upload"
+ },
+ "longRecordingTitle": {
+ "message": "Długie nagranie",
+ "description": "Banner title shown when a recording exceeds the local processing limit but is otherwise successful"
+ },
+ "longRecordingDescription": {
+ "message": "Nagranie jest kompletne i bezpieczne. Pobierz jako WebM poniżej.",
+ "description": "Banner description for long recordings that can be downloaded but not edited locally"
+ },
+ "notAvailableLongRecording": {
+ "message": "Niedostępne dla długich nagrań",
+ "description": "Disabled button label for features not available due to recording length"
+ },
+ "notAvailableRecoveryMode": {
+ "message": "Niedostępne w trybie odzyskiwania",
+ "description": "Disabled button label for features not available in recovery/fallback mode"
+ },
+ "editTooLongTitle": {
+ "message": "Edycja dźwięku zbyt długa",
+ "description": "Alert title when an audio mute/mix edit is rejected because the clip exceeds 15 minutes"
+ },
+ "editTooLongDescription": {
+ "message": "Ta edycja dźwięku nie jest obsługiwana dla klipów dłuższych niż 15 minut. Oryginał nie został zmieniony. Spróbuj najpierw przyciąć klip.",
+ "description": "Alert body explaining the 15-minute limit and suggesting trimming first"
+ },
+ "editTimeoutTitle": {
+ "message": "Czas edycji upłynął",
+ "description": "Alert title when an edit operation does not complete within the 5-minute watchdog period"
+ },
+ "editTimeoutDescription": {
+ "message": "Edycja nie zakończyła się na czas. Oryginalne nagranie nie zostało zmienione. Spróbuj ponownie lub najpierw przytnij klip.",
+ "description": "Alert body for the timeout case, prompting retry or shorter clip"
+ },
+ "streamEndedWarningToast": {
+ "message": "Udostępnianie ekranu zostało zatrzymane. Twoje nagranie jest zapisane. Zatrzymaj, gdy będziesz gotowy.",
+ "description": "Toast shown when screen share track ends mid-recording. Recording continues; removes false urgency about data loss."
+ },
+ "recoveryModeDescription": {
+ "message": "Wystąpił problem z przetwarzaniem, ale Twoje nagranie jest bezpieczne. Możesz je pobrać poniżej.",
+ "description": "Recovery mode banner description — reassures user their recording is accessible despite the processing failure"
+ },
+ "editProcessingSafeDescription": {
+ "message": "Przetwarzanie edycji. Oryginalne nagranie pozostaje niezmienione.",
+ "description": "Shown in the editor processing alert when a user-initiated edit is running, to reassure the original is safe"
+ },
+ "editFailedTitle": {
+ "message": "Nie udało się zastosować edycji",
+ "description": "Alert title when an edit operation fails due to an encoding or processing error"
+ },
+ "editFailedDescription": {
+ "message": "Coś poszło nie tak podczas przetwarzania. Oryginalne nagranie jest bezpieczne. Możesz spróbować ponownie lub pobrać je w obecnej formie.",
+ "description": "Alert body for edit failure; explicitly confirms the original recording is untouched"
+ },
+ "videoTrackEndedToast": {
+ "message": "Udostępnianie ekranu zostało zatrzymane. Zapisywanie nagrania. Wszystko, co zostało przechwycone, jest bezpieczne.",
+ "description": "Toast shown when the video track ends mid-recording (e.g. monitor disconnected, screen share revoked)"
+ },
+ "audioTrackEndedToast": {
+ "message": "Dźwięk został odłączony. Zapisywanie nagrania. Dotychczas przechwycone wideo jest bezpieczne.",
+ "description": "Toast shown when the audio track ends mid-recording (e.g. mic unplugged, permission revoked)"
+ },
+ "editorRecoveryToast": {
+ "message": "Nagranie zostało zapisane. Edytor się nie otworzył. Kliknij ikonę Screenity, aby spróbować ponownie.",
+ "description": "Toast shown on the active tab when the post-recording editor tab fails to open"
+ },
+ "stopAckTimeoutToast": {
+ "message": "Zapisywanie trwa dłużej niż oczekiwano. Twoje dane są bezpieczne. Edytor otworzy się wkrótce.",
+ "description": "Toast shown when the recorder does not acknowledge the stop request within a few seconds"
+ },
+ "copyDebugInfoButton": {
+ "message": "Kopiuj info debugowania",
+ "description": "Button to copy technical debug info to clipboard for support"
+ },
+ "debugInfoCopiedToast": {
+ "message": "Info debugowania skopiowane",
+ "description": "Toast shown after debug info is copied"
+ },
+ "getHelpButton": {
+ "message": "Uzyskaj pomoc",
+ "description": "Side button on error modals that opens a prefilled support form"
+ },
+ "recordingTooShortToast": {
+ "message": "Nagranie było za krótkie, aby je zapisać",
+ "description": "Toast shown when a region recording is stopped by navigation but no chunks were saved"
+ },
+ "fastRecorderFailedTitle": {
+ "message": "Szybki rejestrator nie powi\u00f3d\u0142 si\u0119",
+ "description": "Title for the modal shown when the fast MP4 recorder output could not be validated"
+ },
+ "fastRecorderFailedDescription": {
+ "message": "Wyj\u015bcie szybkiego rejestratora nie mog\u0142o zosta\u0107 zweryfikowane na tym urz\u0105dzeniu.\nMo\u017cesz mimo to pobra\u0107 plik.",
+ "description": "Body text for the fast recorder failure modal"
+ },
+ "downloadAnywayButton": {
+ "message": "Pobierz mimo to",
+ "description": "Button to download the recording file despite validation failure"
+ },
+ "cancelButton": {
+ "message": "Anuluj",
+ "description": "Generic cancel button label"
}
-}
\ No newline at end of file
+}
diff --git a/src/_locales/pt_BR/messages.json b/src/_locales/pt_BR/messages.json
index 2b450e0..f090056 100644
--- a/src/_locales/pt_BR/messages.json
+++ b/src/_locales/pt_BR/messages.json
@@ -1458,8 +1458,8 @@
"description": "Toast shown when a crashed recording session is auto-recovered on startup"
},
"toastStorageCritical": {
- "message": "Low disk space detected. Recording is stopping to avoid corruption.",
- "description": "Toast shown when available storage drops below the critical threshold during recording"
+ "message": "Pouco espaço em disco. Salvando sua gravação. Tudo que foi capturado até agora está seguro.",
+ "description": "Toast shown when available storage drops below the critical threshold during recording; reassures that captured data is preserved"
},
"toastStorageLow": {
"message": "Storage is running low. Upload reliability may degrade for long recordings.",
@@ -1472,5 +1472,105 @@
"toastNetworkOffline": {
"message": "Network offline. Upload paused. Screen chunks are saved locally.",
"description": "Toast shown when the browser goes offline during a cloud recording upload"
+ },
+ "longRecordingTitle": {
+ "message": "Gravação longa",
+ "description": "Banner title shown when a recording exceeds the local processing limit but is otherwise successful"
+ },
+ "longRecordingDescription": {
+ "message": "Sua gravação está completa e segura. Baixe como WebM abaixo.",
+ "description": "Banner description for long recordings that can be downloaded but not edited locally"
+ },
+ "notAvailableLongRecording": {
+ "message": "Indisponível para gravações longas",
+ "description": "Disabled button label for features not available due to recording length"
+ },
+ "notAvailableRecoveryMode": {
+ "message": "Indisponível no modo de recuperação",
+ "description": "Disabled button label for features not available in recovery/fallback mode"
+ },
+ "editTooLongTitle": {
+ "message": "Edição de áudio muito longa",
+ "description": "Alert title when an audio mute/mix edit is rejected because the clip exceeds 15 minutes"
+ },
+ "editTooLongDescription": {
+ "message": "Esta edição de áudio não é suportada para clipes com mais de 15 minutos. Seu original não foi alterado. Tente cortar o clipe primeiro.",
+ "description": "Alert body explaining the 15-minute limit and suggesting trimming first"
+ },
+ "editTimeoutTitle": {
+ "message": "Tempo da edição esgotado",
+ "description": "Alert title when an edit operation does not complete within the 5-minute watchdog period"
+ },
+ "editTimeoutDescription": {
+ "message": "A edição não foi concluída a tempo. Sua gravação original não foi alterada. Tente novamente ou corte o clipe primeiro.",
+ "description": "Alert body for the timeout case, prompting retry or shorter clip"
+ },
+ "streamEndedWarningToast": {
+ "message": "O compartilhamento de tela parou. Sua gravação está salva. Pare quando estiver pronto.",
+ "description": "Toast shown when screen share track ends mid-recording. Recording continues; removes false urgency about data loss."
+ },
+ "recoveryModeDescription": {
+ "message": "Houve um problema no processamento, mas sua gravação está segura. Você pode baixá-la abaixo.",
+ "description": "Recovery mode banner description — reassures user their recording is accessible despite the processing failure"
+ },
+ "editProcessingSafeDescription": {
+ "message": "Processando sua edição. A gravação original não foi alterada.",
+ "description": "Shown in the editor processing alert when a user-initiated edit is running, to reassure the original is safe"
+ },
+ "editFailedTitle": {
+ "message": "Não foi possível aplicar a edição",
+ "description": "Alert title when an edit operation fails due to an encoding or processing error"
+ },
+ "editFailedDescription": {
+ "message": "Algo deu errado durante o processamento. Sua gravação original está segura. Você pode tentar novamente ou baixá-la como está.",
+ "description": "Alert body for edit failure; explicitly confirms the original recording is untouched"
+ },
+ "videoTrackEndedToast": {
+ "message": "O compartilhamento de tela parou. Salvando sua gravação. Tudo que foi capturado até agora está seguro.",
+ "description": "Toast shown when the video track ends mid-recording (e.g. monitor disconnected, screen share revoked)"
+ },
+ "audioTrackEndedToast": {
+ "message": "Áudio desconectado. Salvando sua gravação. O vídeo capturado até agora está seguro.",
+ "description": "Toast shown when the audio track ends mid-recording (e.g. mic unplugged, permission revoked)"
+ },
+ "editorRecoveryToast": {
+ "message": "Sua gravação foi salva. O editor não abriu. Clique no ícone do Screenity para tentar novamente.",
+ "description": "Toast shown on the active tab when the post-recording editor tab fails to open"
+ },
+ "stopAckTimeoutToast": {
+ "message": "O salvamento está demorando mais que o esperado. Seus dados estão seguros. O editor abrirá em breve.",
+ "description": "Toast shown when the recorder does not acknowledge the stop request within a few seconds"
+ },
+ "copyDebugInfoButton": {
+ "message": "Copiar info de depuração",
+ "description": "Button to copy technical debug info to clipboard for support"
+ },
+ "debugInfoCopiedToast": {
+ "message": "Info de depuração copiada",
+ "description": "Toast shown after debug info is copied"
+ },
+ "getHelpButton": {
+ "message": "Obter ajuda",
+ "description": "Side button on error modals that opens a prefilled support form"
+ },
+ "recordingTooShortToast": {
+ "message": "A gravação foi curta demais para salvar",
+ "description": "Toast shown when a region recording is stopped by navigation but no chunks were saved"
+ },
+ "fastRecorderFailedTitle": {
+ "message": "Gravador r\u00e1pido falhou",
+ "description": "Title for the modal shown when the fast MP4 recorder output could not be validated"
+ },
+ "fastRecorderFailedDescription": {
+ "message": "A sa\u00edda do gravador r\u00e1pido n\u00e3o p\u00f4de ser validada neste dispositivo.\nVoc\u00ea pode baixar o arquivo mesmo assim.",
+ "description": "Body text for the fast recorder failure modal"
+ },
+ "downloadAnywayButton": {
+ "message": "Baixar mesmo assim",
+ "description": "Button to download the recording file despite validation failure"
+ },
+ "cancelButton": {
+ "message": "Cancelar",
+ "description": "Generic cancel button label"
}
-}
\ No newline at end of file
+}
diff --git a/src/_locales/pt_PT/messages.json b/src/_locales/pt_PT/messages.json
index d7f8a6a..99dfd8b 100644
--- a/src/_locales/pt_PT/messages.json
+++ b/src/_locales/pt_PT/messages.json
@@ -1458,8 +1458,8 @@
"description": "Toast shown when a crashed recording session is auto-recovered on startup"
},
"toastStorageCritical": {
- "message": "Low disk space detected. Recording is stopping to avoid corruption.",
- "description": "Toast shown when available storage drops below the critical threshold during recording"
+ "message": "Pouco espaço em disco. A guardar a gravação. Tudo o que foi capturado até agora está seguro.",
+ "description": "Toast shown when available storage drops below the critical threshold during recording; reassures that captured data is preserved"
},
"toastStorageLow": {
"message": "Storage is running low. Upload reliability may degrade for long recordings.",
@@ -1472,5 +1472,105 @@
"toastNetworkOffline": {
"message": "Network offline. Upload paused. Screen chunks are saved locally.",
"description": "Toast shown when the browser goes offline during a cloud recording upload"
+ },
+ "longRecordingTitle": {
+ "message": "Gravação longa",
+ "description": "Banner title shown when a recording exceeds the local processing limit but is otherwise successful"
+ },
+ "longRecordingDescription": {
+ "message": "A sua gravação está completa e segura. Transfira como WebM abaixo.",
+ "description": "Banner description for long recordings that can be downloaded but not edited locally"
+ },
+ "notAvailableLongRecording": {
+ "message": "Indisponível para gravações longas",
+ "description": "Disabled button label for features not available due to recording length"
+ },
+ "notAvailableRecoveryMode": {
+ "message": "Indisponível no modo de recuperação",
+ "description": "Disabled button label for features not available in recovery/fallback mode"
+ },
+ "editTooLongTitle": {
+ "message": "Edição de áudio demasiado longa",
+ "description": "Alert title when an audio mute/mix edit is rejected because the clip exceeds 15 minutes"
+ },
+ "editTooLongDescription": {
+ "message": "Esta edição de áudio não é suportada para clipes com mais de 15 minutos. O seu original não foi alterado. Tente cortar o clipe primeiro.",
+ "description": "Alert body explaining the 15-minute limit and suggesting trimming first"
+ },
+ "editTimeoutTitle": {
+ "message": "Tempo da edição esgotado",
+ "description": "Alert title when an edit operation does not complete within the 5-minute watchdog period"
+ },
+ "editTimeoutDescription": {
+ "message": "A edição não foi concluída a tempo. A sua gravação original não foi alterada. Tente novamente ou corte o clipe primeiro.",
+ "description": "Alert body for the timeout case, prompting retry or shorter clip"
+ },
+ "streamEndedWarningToast": {
+ "message": "A partilha de ecrã parou. A sua gravação está guardada. Pare quando estiver pronto.",
+ "description": "Toast shown when screen share track ends mid-recording. Recording continues; removes false urgency about data loss."
+ },
+ "recoveryModeDescription": {
+ "message": "Houve um problema no processamento, mas a sua gravação está segura. Pode transferi-la abaixo.",
+ "description": "Recovery mode banner description — reassures user their recording is accessible despite the processing failure"
+ },
+ "editProcessingSafeDescription": {
+ "message": "A processar a sua edição. A gravação original não foi alterada.",
+ "description": "Shown in the editor processing alert when a user-initiated edit is running, to reassure the original is safe"
+ },
+ "editFailedTitle": {
+ "message": "Não foi possível aplicar a edição",
+ "description": "Alert title when an edit operation fails due to an encoding or processing error"
+ },
+ "editFailedDescription": {
+ "message": "Algo correu mal durante o processamento. A sua gravação original está segura. Pode tentar novamente ou transferi-la como está.",
+ "description": "Alert body for edit failure; explicitly confirms the original recording is untouched"
+ },
+ "videoTrackEndedToast": {
+ "message": "A partilha de ecrã parou. A guardar a gravação. Tudo o que foi capturado até agora está seguro.",
+ "description": "Toast shown when the video track ends mid-recording (e.g. monitor disconnected, screen share revoked)"
+ },
+ "audioTrackEndedToast": {
+ "message": "Áudio desligado. A guardar a gravação. O vídeo capturado até agora está seguro.",
+ "description": "Toast shown when the audio track ends mid-recording (e.g. mic unplugged, permission revoked)"
+ },
+ "editorRecoveryToast": {
+ "message": "A sua gravação foi guardada. O editor não abriu. Clique no ícone do Screenity para tentar novamente.",
+ "description": "Toast shown on the active tab when the post-recording editor tab fails to open"
+ },
+ "stopAckTimeoutToast": {
+ "message": "A gravação está a demorar mais do que o esperado. Os seus dados estão seguros. O editor abrirá em breve.",
+ "description": "Toast shown when the recorder does not acknowledge the stop request within a few seconds"
+ },
+ "copyDebugInfoButton": {
+ "message": "Copiar info de depuração",
+ "description": "Button to copy technical debug info to clipboard for support"
+ },
+ "debugInfoCopiedToast": {
+ "message": "Info de depuração copiada",
+ "description": "Toast shown after debug info is copied"
+ },
+ "getHelpButton": {
+ "message": "Obter ajuda",
+ "description": "Side button on error modals that opens a prefilled support form"
+ },
+ "recordingTooShortToast": {
+ "message": "A gravação foi curta demais para guardar",
+ "description": "Toast shown when a region recording is stopped by navigation but no chunks were saved"
+ },
+ "fastRecorderFailedTitle": {
+ "message": "Gravador r\u00e1pido falhou",
+ "description": "Title for the modal shown when the fast MP4 recorder output could not be validated"
+ },
+ "fastRecorderFailedDescription": {
+ "message": "A sa\u00edda do gravador r\u00e1pido n\u00e3o p\u00f4de ser validada neste dispositivo.\nPode transferir o ficheiro na mesma.",
+ "description": "Body text for the fast recorder failure modal"
+ },
+ "downloadAnywayButton": {
+ "message": "Transferir na mesma",
+ "description": "Button to download the recording file despite validation failure"
+ },
+ "cancelButton": {
+ "message": "Cancelar",
+ "description": "Generic cancel button label"
}
-}
\ No newline at end of file
+}
diff --git a/src/_locales/ru/messages.json b/src/_locales/ru/messages.json
index 7a23593..64b631a 100644
--- a/src/_locales/ru/messages.json
+++ b/src/_locales/ru/messages.json
@@ -1458,8 +1458,8 @@
"description": "Toast shown when a crashed recording session is auto-recovered on startup"
},
"toastStorageCritical": {
- "message": "Low disk space detected. Recording is stopping to avoid corruption.",
- "description": "Toast shown when available storage drops below the critical threshold during recording"
+ "message": "Мало места на диске. Сохраняем запись. Всё, что было записано, в безопасности.",
+ "description": "Toast shown when available storage drops below the critical threshold during recording; reassures that captured data is preserved"
},
"toastStorageLow": {
"message": "Storage is running low. Upload reliability may degrade for long recordings.",
@@ -1472,5 +1472,105 @@
"toastNetworkOffline": {
"message": "Network offline. Upload paused. Screen chunks are saved locally.",
"description": "Toast shown when the browser goes offline during a cloud recording upload"
+ },
+ "longRecordingTitle": {
+ "message": "Длинная запись",
+ "description": "Banner title shown when a recording exceeds the local processing limit but is otherwise successful"
+ },
+ "longRecordingDescription": {
+ "message": "Запись завершена и в безопасности. Скачайте в формате WebM ниже.",
+ "description": "Banner description for long recordings that can be downloaded but not edited locally"
+ },
+ "notAvailableLongRecording": {
+ "message": "Недоступно для длинных записей",
+ "description": "Disabled button label for features not available due to recording length"
+ },
+ "notAvailableRecoveryMode": {
+ "message": "Недоступно в режиме восстановления",
+ "description": "Disabled button label for features not available in recovery/fallback mode"
+ },
+ "editTooLongTitle": {
+ "message": "Редактирование аудио слишком длинное",
+ "description": "Alert title when an audio mute/mix edit is rejected because the clip exceeds 15 minutes"
+ },
+ "editTooLongDescription": {
+ "message": "Это редактирование аудио не поддерживается для клипов длиннее 15 минут. Оригинал не изменён. Попробуйте сначала обрезать клип.",
+ "description": "Alert body explaining the 15-minute limit and suggesting trimming first"
+ },
+ "editTimeoutTitle": {
+ "message": "Время редактирования истекло",
+ "description": "Alert title when an edit operation does not complete within the 5-minute watchdog period"
+ },
+ "editTimeoutDescription": {
+ "message": "Редактирование не завершилось вовремя. Исходная запись не изменена. Повторите попытку или сначала обрежьте клип.",
+ "description": "Alert body for the timeout case, prompting retry or shorter clip"
+ },
+ "streamEndedWarningToast": {
+ "message": "Демонстрация экрана прекращена. Ваша запись сохранена. Остановите, когда будете готовы.",
+ "description": "Toast shown when screen share track ends mid-recording. Recording continues; removes false urgency about data loss."
+ },
+ "recoveryModeDescription": {
+ "message": "Произошла ошибка обработки, но ваша запись в безопасности. Вы можете скачать её ниже.",
+ "description": "Recovery mode banner description — reassures user their recording is accessible despite the processing failure"
+ },
+ "editProcessingSafeDescription": {
+ "message": "Обработка редактирования. Исходная запись не изменена.",
+ "description": "Shown in the editor processing alert when a user-initiated edit is running, to reassure the original is safe"
+ },
+ "editFailedTitle": {
+ "message": "Не удалось применить редактирование",
+ "description": "Alert title when an edit operation fails due to an encoding or processing error"
+ },
+ "editFailedDescription": {
+ "message": "Что-то пошло не так при обработке. Исходная запись в безопасности. Вы можете попробовать снова или скачать как есть.",
+ "description": "Alert body for edit failure; explicitly confirms the original recording is untouched"
+ },
+ "videoTrackEndedToast": {
+ "message": "Демонстрация экрана прекращена. Сохраняем запись. Всё, что было записано, в безопасности.",
+ "description": "Toast shown when the video track ends mid-recording (e.g. monitor disconnected, screen share revoked)"
+ },
+ "audioTrackEndedToast": {
+ "message": "Аудио отключено. Сохраняем запись. Записанное видео в безопасности.",
+ "description": "Toast shown when the audio track ends mid-recording (e.g. mic unplugged, permission revoked)"
+ },
+ "editorRecoveryToast": {
+ "message": "Запись сохранена. Редактор не открылся. Нажмите на значок Screenity, чтобы попробовать снова.",
+ "description": "Toast shown on the active tab when the post-recording editor tab fails to open"
+ },
+ "stopAckTimeoutToast": {
+ "message": "Сохранение занимает больше времени, чем ожидалось. Ваши данные в безопасности. Редактор скоро откроется.",
+ "description": "Toast shown when the recorder does not acknowledge the stop request within a few seconds"
+ },
+ "copyDebugInfoButton": {
+ "message": "Скопировать данные отладки",
+ "description": "Button to copy technical debug info to clipboard for support"
+ },
+ "debugInfoCopiedToast": {
+ "message": "Данные отладки скопированы",
+ "description": "Toast shown after debug info is copied"
+ },
+ "getHelpButton": {
+ "message": "Получить помощь",
+ "description": "Side button on error modals that opens a prefilled support form"
+ },
+ "recordingTooShortToast": {
+ "message": "Запись слишком короткая для сохранения",
+ "description": "Toast shown when a region recording is stopped by navigation but no chunks were saved"
+ },
+ "fastRecorderFailedTitle": {
+ "message": "Быстрая запись не удалась",
+ "description": "Title for the modal shown when the fast MP4 recorder output could not be validated"
+ },
+ "fastRecorderFailedDescription": {
+ "message": "Результат быстрой записи не удалось проверить на этом устройстве.\nВы все равно можете скачать файл.",
+ "description": "Body text for the fast recorder failure modal"
+ },
+ "downloadAnywayButton": {
+ "message": "Скачать все равно",
+ "description": "Button to download the recording file despite validation failure"
+ },
+ "cancelButton": {
+ "message": "Отмена",
+ "description": "Generic cancel button label"
}
-}
\ No newline at end of file
+}
diff --git a/src/_locales/ta/messages.json b/src/_locales/ta/messages.json
index 924a8db..f8a2bce 100644
--- a/src/_locales/ta/messages.json
+++ b/src/_locales/ta/messages.json
@@ -1458,8 +1458,8 @@
"description": "Toast shown when a crashed recording session is auto-recovered on startup"
},
"toastStorageCritical": {
- "message": "Low disk space detected. Recording is stopping to avoid corruption.",
- "description": "Toast shown when available storage drops below the critical threshold during recording"
+ "message": "டிஸ்க் இடம் குறைவு. உங்கள் பதிவு சேமிக்கப்படுகிறது. இதுவரை பதிவான அனைத்தும் பாதுகாப்பாக உள்ளது.",
+ "description": "Toast shown when available storage drops below the critical threshold during recording; reassures that captured data is preserved"
},
"toastStorageLow": {
"message": "Storage is running low. Upload reliability may degrade for long recordings.",
@@ -1472,5 +1472,105 @@
"toastNetworkOffline": {
"message": "Network offline. Upload paused. Screen chunks are saved locally.",
"description": "Toast shown when the browser goes offline during a cloud recording upload"
+ },
+ "longRecordingTitle": {
+ "message": "நீண்ட பதிவு",
+ "description": "Banner title shown when a recording exceeds the local processing limit but is otherwise successful"
+ },
+ "longRecordingDescription": {
+ "message": "உங்கள் பதிவு முழுமையானது மற்றும் பாதுகாப்பானது. கீழே WebM ஆக பதிவிறக்கம் செய்யுங்கள்.",
+ "description": "Banner description for long recordings that can be downloaded but not edited locally"
+ },
+ "notAvailableLongRecording": {
+ "message": "நீண்ட பதிவுகளுக்கு கிடைக்காது",
+ "description": "Disabled button label for features not available due to recording length"
+ },
+ "notAvailableRecoveryMode": {
+ "message": "மீட்டமைப்பு முறையில் கிடைக்காது",
+ "description": "Disabled button label for features not available in recovery/fallback mode"
+ },
+ "editTooLongTitle": {
+ "message": "ஆடியோ திருத்தம் மிக நீளமானது",
+ "description": "Alert title when an audio mute/mix edit is rejected because the clip exceeds 15 minutes"
+ },
+ "editTooLongDescription": {
+ "message": "இந்த ஆடியோ திருத்தம் 15 நிமிடங்களுக்கு மேல் உள்ள கிளிப்களுக்கு ஆதரவில்லை. அசல் மாற்றப்படவில்லை. முதலில் கிளிப்பை வெட்டி சுருக்க முயற்சிக்கவும்.",
+ "description": "Alert body explaining the 15-minute limit and suggesting trimming first"
+ },
+ "editTimeoutTitle": {
+ "message": "திருத்தத்திற்கான நேரம் முடிந்தது",
+ "description": "Alert title when an edit operation does not complete within the 5-minute watchdog period"
+ },
+ "editTimeoutDescription": {
+ "message": "திருத்தம் சரியான நேரத்தில் முடியவில்லை. அசல் பதிவு மாற்றப்படவில்லை. மீண்டும் முயற்சிக்கவும் அல்லது முதலில் கிளிப்பை வெட்டுங்கள்.",
+ "description": "Alert body for the timeout case, prompting retry or shorter clip"
+ },
+ "streamEndedWarningToast": {
+ "message": "திரைப் பகிர்வு நிறுத்தப்பட்டது. உங்கள் பதிவு சேமிக்கப்பட்டது. தயாரானதும் நிறுத்துங்கள்.",
+ "description": "Toast shown when screen share track ends mid-recording. Recording continues; removes false urgency about data loss."
+ },
+ "recoveryModeDescription": {
+ "message": "செயலாக்கத்தில் சிக்கல் ஏற்பட்டது, ஆனால் உங்கள் பதிவு பாதுகாப்பாக உள்ளது. கீழே பதிவிறக்கம் செய்யலாம்.",
+ "description": "Recovery mode banner description — reassures user their recording is accessible despite the processing failure"
+ },
+ "editProcessingSafeDescription": {
+ "message": "உங்கள் திருத்தம் செயலாக்கப்படுகிறது. அசல் பதிவு மாற்றப்படவில்லை.",
+ "description": "Shown in the editor processing alert when a user-initiated edit is running, to reassure the original is safe"
+ },
+ "editFailedTitle": {
+ "message": "திருத்தத்தைப் பயன்படுத்த முடியவில்லை",
+ "description": "Alert title when an edit operation fails due to an encoding or processing error"
+ },
+ "editFailedDescription": {
+ "message": "செயலாக்கத்தின் போது ஏதோ தவறு ஏற்பட்டது. உங்கள் அசல் பதிவு பாதுகாப்பாக உள்ளது. மீண்டும் முயற்சிக்கலாம் அல்லது அப்படியே பதிவிறக்கம் செய்யலாம்.",
+ "description": "Alert body for edit failure; explicitly confirms the original recording is untouched"
+ },
+ "videoTrackEndedToast": {
+ "message": "திரைப் பகிர்வு நிறுத்தப்பட்டது. உங்கள் பதிவு சேமிக்கப்படுகிறது. இதுவரை பதிவான அனைத்தும் பாதுகாப்பாக உள்ளது.",
+ "description": "Toast shown when the video track ends mid-recording (e.g. monitor disconnected, screen share revoked)"
+ },
+ "audioTrackEndedToast": {
+ "message": "ஆடியோ துண்டிக்கப்பட்டது. உங்கள் பதிவு சேமிக்கப்படுகிறது. இதுவரை பதிவான வீடியோ பாதுகாப்பாக உள்ளது.",
+ "description": "Toast shown when the audio track ends mid-recording (e.g. mic unplugged, permission revoked)"
+ },
+ "editorRecoveryToast": {
+ "message": "உங்கள் பதிவு சேமிக்கப்பட்டது. எடிட்டர் திறக்கப்படவில்லை. மீண்டும் முயற்சிக்க Screenity சின்னத்தைக் கிளிக் செய்யுங்கள்.",
+ "description": "Toast shown on the active tab when the post-recording editor tab fails to open"
+ },
+ "stopAckTimeoutToast": {
+ "message": "சேமிப்பு எதிர்பார்த்ததை விட அதிக நேரம் எடுக்கிறது. உங்கள் தரவு பாதுகாப்பாக உள்ளது. எடிட்டர் விரைவில் திறக்கும்.",
+ "description": "Toast shown when the recorder does not acknowledge the stop request within a few seconds"
+ },
+ "copyDebugInfoButton": {
+ "message": "Debug தகவலை நகலெடு",
+ "description": "Button to copy technical debug info to clipboard for support"
+ },
+ "debugInfoCopiedToast": {
+ "message": "Debug தகவல் நகலெடுக்கப்பட்டது",
+ "description": "Toast shown after debug info is copied"
+ },
+ "getHelpButton": {
+ "message": "உதவி பெறுங்கள்",
+ "description": "Side button on error modals that opens a prefilled support form"
+ },
+ "recordingTooShortToast": {
+ "message": "பதிவு சேமிக்க முடியாத அளவுக்கு சிறியது",
+ "description": "Toast shown when a region recording is stopped by navigation but no chunks were saved"
+ },
+ "fastRecorderFailedTitle": {
+ "message": "வேகமான பதிவி தோல்வியடைந்தது",
+ "description": "Title for the modal shown when the fast MP4 recorder output could not be validated"
+ },
+ "fastRecorderFailedDescription": {
+ "message": "இந்த சாதனத்தில் வேகமான பதிவியின் வெளியீட்டைச் சரிபார்க்க முடியவில்லை.\nநீங்கள் கோப்பை எப்படியும் பதிவிறக்கலாம்.",
+ "description": "Body text for the fast recorder failure modal"
+ },
+ "downloadAnywayButton": {
+ "message": "எப்படியும் பதிவிறக்கு",
+ "description": "Button to download the recording file despite validation failure"
+ },
+ "cancelButton": {
+ "message": "ரத்துசெய்",
+ "description": "Generic cancel button label"
}
-}
\ No newline at end of file
+}
diff --git a/src/_locales/tr/messages.json b/src/_locales/tr/messages.json
index 6ce89a4..f66eea1 100644
--- a/src/_locales/tr/messages.json
+++ b/src/_locales/tr/messages.json
@@ -1458,8 +1458,8 @@
"description": "Toast shown when a crashed recording session is auto-recovered on startup"
},
"toastStorageCritical": {
- "message": "Low disk space detected. Recording is stopping to avoid corruption.",
- "description": "Toast shown when available storage drops below the critical threshold during recording"
+ "message": "Disk alanı düşük. Kaydınız şimdi kaydediliyor. Şimdiye kadar yakalanan her şey güvende.",
+ "description": "Toast shown when available storage drops below the critical threshold during recording; reassures that captured data is preserved"
},
"toastStorageLow": {
"message": "Storage is running low. Upload reliability may degrade for long recordings.",
@@ -1472,5 +1472,105 @@
"toastNetworkOffline": {
"message": "Network offline. Upload paused. Screen chunks are saved locally.",
"description": "Toast shown when the browser goes offline during a cloud recording upload"
+ },
+ "longRecordingTitle": {
+ "message": "Uzun kayıt",
+ "description": "Banner title shown when a recording exceeds the local processing limit but is otherwise successful"
+ },
+ "longRecordingDescription": {
+ "message": "Kaydınız tamamlandı ve güvende. Aşağıdan WebM olarak indirin.",
+ "description": "Banner description for long recordings that can be downloaded but not edited locally"
+ },
+ "notAvailableLongRecording": {
+ "message": "Uzun kayıtlar için kullanılamıyor",
+ "description": "Disabled button label for features not available due to recording length"
+ },
+ "notAvailableRecoveryMode": {
+ "message": "Kurtarma modunda kullanılamıyor",
+ "description": "Disabled button label for features not available in recovery/fallback mode"
+ },
+ "editTooLongTitle": {
+ "message": "Ses düzenlemesi çok uzun",
+ "description": "Alert title when an audio mute/mix edit is rejected because the clip exceeds 15 minutes"
+ },
+ "editTooLongDescription": {
+ "message": "Bu ses düzenlemesi 15 dakikadan uzun klipler için desteklenmiyor. Orijinaliniz değişmedi. Önce klibi kırpmayı deneyin.",
+ "description": "Alert body explaining the 15-minute limit and suggesting trimming first"
+ },
+ "editTimeoutTitle": {
+ "message": "Düzenleme zaman aşımına uğradı",
+ "description": "Alert title when an edit operation does not complete within the 5-minute watchdog period"
+ },
+ "editTimeoutDescription": {
+ "message": "Düzenleme zamanında tamamlanamadı. Orijinal kaydınız değişmedi. Tekrar deneyin veya önce klibi kırpın.",
+ "description": "Alert body for the timeout case, prompting retry or shorter clip"
+ },
+ "streamEndedWarningToast": {
+ "message": "Ekran paylaşımı durdu. Kaydınız kaydedildi. Hazır olduğunuzda durdurun.",
+ "description": "Toast shown when screen share track ends mid-recording. Recording continues; removes false urgency about data loss."
+ },
+ "recoveryModeDescription": {
+ "message": "Bir işleme sorunu oluştu, ancak kaydınız güvende. Aşağıdan indirebilirsiniz.",
+ "description": "Recovery mode banner description — reassures user their recording is accessible despite the processing failure"
+ },
+ "editProcessingSafeDescription": {
+ "message": "Düzenlemeniz işleniyor. Orijinal kaydınız değiştirilmedi.",
+ "description": "Shown in the editor processing alert when a user-initiated edit is running, to reassure the original is safe"
+ },
+ "editFailedTitle": {
+ "message": "Düzenleme uygulanamadı",
+ "description": "Alert title when an edit operation fails due to an encoding or processing error"
+ },
+ "editFailedDescription": {
+ "message": "İşleme sırasında bir sorun oluştu. Orijinal kaydınız güvende. Tekrar deneyebilir veya olduğu gibi indirebilirsiniz.",
+ "description": "Alert body for edit failure; explicitly confirms the original recording is untouched"
+ },
+ "videoTrackEndedToast": {
+ "message": "Ekran paylaşımı durdu. Kaydınız şimdi kaydediliyor. Şimdiye kadar yakalanan her şey güvende.",
+ "description": "Toast shown when the video track ends mid-recording (e.g. monitor disconnected, screen share revoked)"
+ },
+ "audioTrackEndedToast": {
+ "message": "Ses bağlantısı kesildi. Kaydınız şimdi kaydediliyor. Şimdiye kadar yakalanan video güvende.",
+ "description": "Toast shown when the audio track ends mid-recording (e.g. mic unplugged, permission revoked)"
+ },
+ "editorRecoveryToast": {
+ "message": "Kaydınız kaydedildi. Düzenleyici açılmadı. Tekrar denemek için Screenity simgesine tıklayın.",
+ "description": "Toast shown on the active tab when the post-recording editor tab fails to open"
+ },
+ "stopAckTimeoutToast": {
+ "message": "Kaydetme beklenenden uzun sürüyor. Verileriniz güvende. Düzenleyici kısa süre içinde açılacak.",
+ "description": "Toast shown when the recorder does not acknowledge the stop request within a few seconds"
+ },
+ "copyDebugInfoButton": {
+ "message": "Hata ayıklama bilgisini kopyala",
+ "description": "Button to copy technical debug info to clipboard for support"
+ },
+ "debugInfoCopiedToast": {
+ "message": "Hata ayıklama bilgisi kopyalandı",
+ "description": "Toast shown after debug info is copied"
+ },
+ "getHelpButton": {
+ "message": "Yardım al",
+ "description": "Side button on error modals that opens a prefilled support form"
+ },
+ "recordingTooShortToast": {
+ "message": "Kayıt kaydedilemeyecek kadar kısa",
+ "description": "Toast shown when a region recording is stopped by navigation but no chunks were saved"
+ },
+ "fastRecorderFailedTitle": {
+ "message": "H\u0131zl\u0131 kay\u0131t ba\u015far\u0131s\u0131z oldu",
+ "description": "Title for the modal shown when the fast MP4 recorder output could not be validated"
+ },
+ "fastRecorderFailedDescription": {
+ "message": "H\u0131zl\u0131 kaydedicinin \u00e7\u0131kt\u0131s\u0131 bu cihazda do\u011frulanamad\u0131.\nDosyay\u0131 yine de indirebilirsiniz.",
+ "description": "Body text for the fast recorder failure modal"
+ },
+ "downloadAnywayButton": {
+ "message": "Yine de indir",
+ "description": "Button to download the recording file despite validation failure"
+ },
+ "cancelButton": {
+ "message": "\u0130ptal",
+ "description": "Generic cancel button label"
}
-}
\ No newline at end of file
+}
diff --git a/src/_locales/uk/messages.json b/src/_locales/uk/messages.json
index c14f2b0..29240a9 100644
--- a/src/_locales/uk/messages.json
+++ b/src/_locales/uk/messages.json
@@ -1450,8 +1450,8 @@
"description": "Toast shown when a crashed recording session is auto-recovered on startup"
},
"toastStorageCritical": {
- "message": "Low disk space detected. Recording is stopping to avoid corruption.",
- "description": "Toast shown when available storage drops below the critical threshold during recording"
+ "message": "Мало місця на диску. Зберігаємо запис. Все, що було записано, у безпеці.",
+ "description": "Toast shown when available storage drops below the critical threshold during recording; reassures that captured data is preserved"
},
"toastStorageLow": {
"message": "Storage is running low. Upload reliability may degrade for long recordings.",
@@ -1464,5 +1464,105 @@
"toastNetworkOffline": {
"message": "Network offline. Upload paused. Screen chunks are saved locally.",
"description": "Toast shown when the browser goes offline during a cloud recording upload"
+ },
+ "longRecordingTitle": {
+ "message": "Довгий запис",
+ "description": "Banner title shown when a recording exceeds the local processing limit but is otherwise successful"
+ },
+ "longRecordingDescription": {
+ "message": "Ваш запис завершено і він у безпеці. Завантажте у форматі WebM нижче.",
+ "description": "Banner description for long recordings that can be downloaded but not edited locally"
+ },
+ "notAvailableLongRecording": {
+ "message": "Недоступно для довгих записів",
+ "description": "Disabled button label for features not available due to recording length"
+ },
+ "notAvailableRecoveryMode": {
+ "message": "Недоступно в режимі відновлення",
+ "description": "Disabled button label for features not available in recovery/fallback mode"
+ },
+ "editTooLongTitle": {
+ "message": "Редагування аудіо занадто довге",
+ "description": "Alert title when an audio mute/mix edit is rejected because the clip exceeds 15 minutes"
+ },
+ "editTooLongDescription": {
+ "message": "Це редагування аудіо не підтримується для кліпів довших за 15 хвилин. Оригінал не змінено. Спробуйте спочатку обрізати кліп.",
+ "description": "Alert body explaining the 15-minute limit and suggesting trimming first"
+ },
+ "editTimeoutTitle": {
+ "message": "Час редагування вичерпано",
+ "description": "Alert title when an edit operation does not complete within the 5-minute watchdog period"
+ },
+ "editTimeoutDescription": {
+ "message": "Редагування не завершилось вчасно. Оригінальний запис не змінено. Спробуйте ще раз або спочатку обріжте кліп.",
+ "description": "Alert body for the timeout case, prompting retry or shorter clip"
+ },
+ "streamEndedWarningToast": {
+ "message": "Демонстрацію екрана зупинено. Ваш запис збережено. Зупиніть, коли будете готові.",
+ "description": "Toast shown when screen share track ends mid-recording. Recording continues; removes false urgency about data loss."
+ },
+ "recoveryModeDescription": {
+ "message": "Виникла помилка обробки, але ваш запис у безпеці. Ви можете завантажити його нижче.",
+ "description": "Recovery mode banner description — reassures user their recording is accessible despite the processing failure"
+ },
+ "editProcessingSafeDescription": {
+ "message": "Обробка редагування. Оригінальний запис не змінено.",
+ "description": "Shown in the editor processing alert when a user-initiated edit is running, to reassure the original is safe"
+ },
+ "editFailedTitle": {
+ "message": "Не вдалося застосувати редагування",
+ "description": "Alert title when an edit operation fails due to an encoding or processing error"
+ },
+ "editFailedDescription": {
+ "message": "Щось пішло не так під час обробки. Оригінальний запис у безпеці. Ви можете спробувати знову або завантажити як є.",
+ "description": "Alert body for edit failure; explicitly confirms the original recording is untouched"
+ },
+ "videoTrackEndedToast": {
+ "message": "Демонстрацію екрана зупинено. Зберігаємо запис. Все, що було записано, у безпеці.",
+ "description": "Toast shown when the video track ends mid-recording (e.g. monitor disconnected, screen share revoked)"
+ },
+ "audioTrackEndedToast": {
+ "message": "Аудіо від'єднано. Зберігаємо запис. Записане відео у безпеці.",
+ "description": "Toast shown when the audio track ends mid-recording (e.g. mic unplugged, permission revoked)"
+ },
+ "editorRecoveryToast": {
+ "message": "Запис збережено. Редактор не відкрився. Натисніть на значок Screenity, щоб спробувати знову.",
+ "description": "Toast shown on the active tab when the post-recording editor tab fails to open"
+ },
+ "stopAckTimeoutToast": {
+ "message": "Збереження триває довше, ніж очікувалось. Ваші дані у безпеці. Редактор незабаром відкриється.",
+ "description": "Toast shown when the recorder does not acknowledge the stop request within a few seconds"
+ },
+ "copyDebugInfoButton": {
+ "message": "Скопіювати дані відлагодження",
+ "description": "Button to copy technical debug info to clipboard for support"
+ },
+ "debugInfoCopiedToast": {
+ "message": "Дані відлагодження скопійовано",
+ "description": "Toast shown after debug info is copied"
+ },
+ "getHelpButton": {
+ "message": "Отримати допомогу",
+ "description": "Side button on error modals that opens a prefilled support form"
+ },
+ "recordingTooShortToast": {
+ "message": "Запис занадто короткий для збереження",
+ "description": "Toast shown when a region recording is stopped by navigation but no chunks were saved"
+ },
+ "fastRecorderFailedTitle": {
+ "message": "Швидкий запис не вдався",
+ "description": "Title for the modal shown when the fast MP4 recorder output could not be validated"
+ },
+ "fastRecorderFailedDescription": {
+ "message": "Результат швидкого запису не вдалося перевірити на цьому пристрої.\nВи все одно можете завантажити файл.",
+ "description": "Body text for the fast recorder failure modal"
+ },
+ "downloadAnywayButton": {
+ "message": "Завантажити все одно",
+ "description": "Button to download the recording file despite validation failure"
+ },
+ "cancelButton": {
+ "message": "Скасувати",
+ "description": "Generic cancel button label"
}
-}
\ No newline at end of file
+}
diff --git a/src/_locales/zh_CN/messages.json b/src/_locales/zh_CN/messages.json
index abbd40f..e506c8c 100644
--- a/src/_locales/zh_CN/messages.json
+++ b/src/_locales/zh_CN/messages.json
@@ -1454,8 +1454,8 @@
"description": "Toast shown when a crashed recording session is auto-recovered on startup"
},
"toastStorageCritical": {
- "message": "Low disk space detected. Recording is stopping to avoid corruption.",
- "description": "Toast shown when available storage drops below the critical threshold during recording"
+ "message": "磁盘空间不足,正在保存录制内容。已录制的内容是安全的。",
+ "description": "Toast shown when available storage drops below the critical threshold during recording; reassures that captured data is preserved"
},
"toastStorageLow": {
"message": "Storage is running low. Upload reliability may degrade for long recordings.",
@@ -1468,5 +1468,105 @@
"toastNetworkOffline": {
"message": "Network offline. Upload paused. Screen chunks are saved locally.",
"description": "Toast shown when the browser goes offline during a cloud recording upload"
+ },
+ "longRecordingTitle": {
+ "message": "长录制",
+ "description": "Banner title shown when a recording exceeds the local processing limit but is otherwise successful"
+ },
+ "longRecordingDescription": {
+ "message": "您的录制已完成且安全。请在下方下载 WebM 文件。",
+ "description": "Banner description for long recordings that can be downloaded but not edited locally"
+ },
+ "notAvailableLongRecording": {
+ "message": "长录制不可用",
+ "description": "Disabled button label for features not available due to recording length"
+ },
+ "notAvailableRecoveryMode": {
+ "message": "恢复模式下不可用",
+ "description": "Disabled button label for features not available in recovery/fallback mode"
+ },
+ "editTooLongTitle": {
+ "message": "音频编辑内容过长",
+ "description": "Alert title when an audio mute/mix edit is rejected because the clip exceeds 15 minutes"
+ },
+ "editTooLongDescription": {
+ "message": "此音频编辑不支持超过15分钟的片段。原始文件未被修改。请先尝试裁剪片段。",
+ "description": "Alert body explaining the 15-minute limit and suggesting trimming first"
+ },
+ "editTimeoutTitle": {
+ "message": "编辑超时",
+ "description": "Alert title when an edit operation does not complete within the 5-minute watchdog period"
+ },
+ "editTimeoutDescription": {
+ "message": "编辑未能及时完成。原始录制内容未被修改。请重试,或先裁剪片段。",
+ "description": "Alert body for the timeout case, prompting retry or shorter clip"
+ },
+ "streamEndedWarningToast": {
+ "message": "屏幕共享已停止。您的录制内容已保存,准备好后即可停止。",
+ "description": "Toast shown when screen share track ends mid-recording. Recording continues; removes false urgency about data loss."
+ },
+ "recoveryModeDescription": {
+ "message": "处理时出现问题,但您的录制内容是安全的。您可以在下方下载。",
+ "description": "Recovery mode banner description — reassures user their recording is accessible despite the processing failure"
+ },
+ "editProcessingSafeDescription": {
+ "message": "正在处理编辑。原始录制内容未受影响。",
+ "description": "Shown in the editor processing alert when a user-initiated edit is running, to reassure the original is safe"
+ },
+ "editFailedTitle": {
+ "message": "无法应用编辑",
+ "description": "Alert title when an edit operation fails due to an encoding or processing error"
+ },
+ "editFailedDescription": {
+ "message": "处理过程中出现问题。原始录制内容是安全的。您可以重试或直接下载。",
+ "description": "Alert body for edit failure; explicitly confirms the original recording is untouched"
+ },
+ "videoTrackEndedToast": {
+ "message": "屏幕共享已停止,正在保存录制内容。已录制的内容是安全的。",
+ "description": "Toast shown when the video track ends mid-recording (e.g. monitor disconnected, screen share revoked)"
+ },
+ "audioTrackEndedToast": {
+ "message": "音频已断开,正在保存录制内容。已录制的视频是安全的。",
+ "description": "Toast shown when the audio track ends mid-recording (e.g. mic unplugged, permission revoked)"
+ },
+ "editorRecoveryToast": {
+ "message": "录制内容已保存。编辑器未打开,请点击 Screenity 图标重试。",
+ "description": "Toast shown on the active tab when the post-recording editor tab fails to open"
+ },
+ "stopAckTimeoutToast": {
+ "message": "保存时间比预期长。您的数据是安全的,编辑器即将打开。",
+ "description": "Toast shown when the recorder does not acknowledge the stop request within a few seconds"
+ },
+ "copyDebugInfoButton": {
+ "message": "复制调试信息",
+ "description": "Button to copy technical debug info to clipboard for support"
+ },
+ "debugInfoCopiedToast": {
+ "message": "调试信息已复制",
+ "description": "Toast shown after debug info is copied"
+ },
+ "getHelpButton": {
+ "message": "获取帮助",
+ "description": "Side button on error modals that opens a prefilled support form"
+ },
+ "recordingTooShortToast": {
+ "message": "录制时间太短,无法保存",
+ "description": "Toast shown when a region recording is stopped by navigation but no chunks were saved"
+ },
+ "fastRecorderFailedTitle": {
+ "message": "快速录制器失败",
+ "description": "Title for the modal shown when the fast MP4 recorder output could not be validated"
+ },
+ "fastRecorderFailedDescription": {
+ "message": "快速录制器的输出无法在此设备上验证。\n您仍可以下载该文件。",
+ "description": "Body text for the fast recorder failure modal"
+ },
+ "downloadAnywayButton": {
+ "message": "仍然下载",
+ "description": "Button to download the recording file despite validation failure"
+ },
+ "cancelButton": {
+ "message": "取消",
+ "description": "Generic cancel button label"
}
-}
\ No newline at end of file
+}
diff --git a/src/_locales/zh_TW/messages.json b/src/_locales/zh_TW/messages.json
index 811aed8..485fa14 100644
--- a/src/_locales/zh_TW/messages.json
+++ b/src/_locales/zh_TW/messages.json
@@ -1458,8 +1458,8 @@
"description": "Toast shown when a crashed recording session is auto-recovered on startup"
},
"toastStorageCritical": {
- "message": "Low disk space detected. Recording is stopping to avoid corruption.",
- "description": "Toast shown when available storage drops below the critical threshold during recording"
+ "message": "磁碟空間不足,正在儲存錄製內容。已錄製的內容是安全的。",
+ "description": "Toast shown when available storage drops below the critical threshold during recording; reassures that captured data is preserved"
},
"toastStorageLow": {
"message": "Storage is running low. Upload reliability may degrade for long recordings.",
@@ -1472,5 +1472,105 @@
"toastNetworkOffline": {
"message": "Network offline. Upload paused. Screen chunks are saved locally.",
"description": "Toast shown when the browser goes offline during a cloud recording upload"
+ },
+ "longRecordingTitle": {
+ "message": "長時間錄製",
+ "description": "Banner title shown when a recording exceeds the local processing limit but is otherwise successful"
+ },
+ "longRecordingDescription": {
+ "message": "您的錄製已完成且安全。請在下方下載 WebM 檔案。",
+ "description": "Banner description for long recordings that can be downloaded but not edited locally"
+ },
+ "notAvailableLongRecording": {
+ "message": "長時間錄製無法使用",
+ "description": "Disabled button label for features not available due to recording length"
+ },
+ "notAvailableRecoveryMode": {
+ "message": "復原模式下無法使用",
+ "description": "Disabled button label for features not available in recovery/fallback mode"
+ },
+ "editTooLongTitle": {
+ "message": "音訊編輯內容過長",
+ "description": "Alert title when an audio mute/mix edit is rejected because the clip exceeds 15 minutes"
+ },
+ "editTooLongDescription": {
+ "message": "此音訊編輯不支援超過15分鐘的片段。原始檔案未被修改。請先嘗試裁剪片段。",
+ "description": "Alert body explaining the 15-minute limit and suggesting trimming first"
+ },
+ "editTimeoutTitle": {
+ "message": "編輯逾時",
+ "description": "Alert title when an edit operation does not complete within the 5-minute watchdog period"
+ },
+ "editTimeoutDescription": {
+ "message": "編輯未能及時完成。原始錄製內容未被修改。請重試,或先裁剪片段。",
+ "description": "Alert body for the timeout case, prompting retry or shorter clip"
+ },
+ "streamEndedWarningToast": {
+ "message": "螢幕分享已停止。您的錄製內容已儲存,準備好後即可停止。",
+ "description": "Toast shown when screen share track ends mid-recording. Recording continues; removes false urgency about data loss."
+ },
+ "recoveryModeDescription": {
+ "message": "處理時出現問題,但您的錄製內容是安全的。您可以在下方下載。",
+ "description": "Recovery mode banner description — reassures user their recording is accessible despite the processing failure"
+ },
+ "editProcessingSafeDescription": {
+ "message": "正在處理編輯。原始錄製內容未受影響。",
+ "description": "Shown in the editor processing alert when a user-initiated edit is running, to reassure the original is safe"
+ },
+ "editFailedTitle": {
+ "message": "無法套用編輯",
+ "description": "Alert title when an edit operation fails due to an encoding or processing error"
+ },
+ "editFailedDescription": {
+ "message": "處理過程中出現問題。原始錄製內容是安全的。您可以重試或直接下載。",
+ "description": "Alert body for edit failure; explicitly confirms the original recording is untouched"
+ },
+ "videoTrackEndedToast": {
+ "message": "螢幕分享已停止,正在儲存錄製內容。已錄製的內容是安全的。",
+ "description": "Toast shown when the video track ends mid-recording (e.g. monitor disconnected, screen share revoked)"
+ },
+ "audioTrackEndedToast": {
+ "message": "音訊已中斷,正在儲存錄製內容。已錄製的影片是安全的。",
+ "description": "Toast shown when the audio track ends mid-recording (e.g. mic unplugged, permission revoked)"
+ },
+ "editorRecoveryToast": {
+ "message": "錄製內容已儲存。編輯器未開啟,請點擊 Screenity 圖示重試。",
+ "description": "Toast shown on the active tab when the post-recording editor tab fails to open"
+ },
+ "stopAckTimeoutToast": {
+ "message": "儲存時間比預期長。您的資料是安全的,編輯器即將開啟。",
+ "description": "Toast shown when the recorder does not acknowledge the stop request within a few seconds"
+ },
+ "copyDebugInfoButton": {
+ "message": "複製除錯資訊",
+ "description": "Button to copy technical debug info to clipboard for support"
+ },
+ "debugInfoCopiedToast": {
+ "message": "除錯資訊已複製",
+ "description": "Toast shown after debug info is copied"
+ },
+ "getHelpButton": {
+ "message": "取得幫助",
+ "description": "Side button on error modals that opens a prefilled support form"
+ },
+ "recordingTooShortToast": {
+ "message": "錄製時間太短,無法儲存",
+ "description": "Toast shown when a region recording is stopped by navigation but no chunks were saved"
+ },
+ "fastRecorderFailedTitle": {
+ "message": "快速錄製器失敗",
+ "description": "Title for the modal shown when the fast MP4 recorder output could not be validated"
+ },
+ "fastRecorderFailedDescription": {
+ "message": "快速錄製器的輸出無法在此裝置上驗證。\n您仍可以下載該檔案。",
+ "description": "Body text for the fast recorder failure modal"
+ },
+ "downloadAnywayButton": {
+ "message": "仍然下載",
+ "description": "Button to download the recording file despite validation failure"
+ },
+ "cancelButton": {
+ "message": "取消",
+ "description": "Generic cancel button label"
}
-}
\ No newline at end of file
+}
diff --git a/src/manifest.json b/src/manifest.json
index df42ce9..e6873d3 100755
--- a/src/manifest.json
+++ b/src/manifest.json
@@ -3,7 +3,7 @@
"name": "__MSG_extName__",
"description": "__MSG_extDesc__",
"default_locale": "en",
- "version": "4.3.1",
+ "version": "4.3.2",
"background": {
"service_worker": "background.bundle.js"
},
diff --git a/src/pages/Background/auth/loginWithWebsite.js b/src/pages/Background/auth/loginWithWebsite.js
index cfbc510..4afe59e 100644
--- a/src/pages/Background/auth/loginWithWebsite.js
+++ b/src/pages/Background/auth/loginWithWebsite.js
@@ -8,6 +8,14 @@ export const loginWithWebsite = async () => {
if (!CLOUD_FEATURES_ENABLED) {
return { authenticated: false, instantMode: false };
}
+
+ // User explicitly chose to stay logged out — respect that until they
+ // initiate a login themselves (handle-login clears this flag).
+ const { stayLoggedOut } = await chrome.storage.local.get(["stayLoggedOut"]);
+ if (stayLoggedOut) {
+ return { authenticated: false, instantMode: false };
+ }
+
const { screenityToken, lastAuthCheck, instantMode } =
await chrome.storage.local.get([
"screenityToken",
@@ -44,18 +52,6 @@ export const loginWithWebsite = async () => {
wasLoggedIn: false,
});
- const { originalTabId } = await chrome.storage.local.get("originalTabId");
-
- if (originalTabId) {
- chrome.tabs.update(originalTabId, { active: true });
-
- sendMessageTab(originalTabId, { type: "LOGIN_SUCCESS" });
-
- sendMessageTab(originalTabId, {
- type: "check-auth",
- });
- }
-
return {
authenticated: true,
user: screenityUser,
@@ -103,6 +99,9 @@ export const loginWithWebsite = async () => {
const { originalTabId } = await chrome.storage.local.get("originalTabId");
if (originalTabId) {
+ // Clear immediately so subsequent cached calls don't re-fire.
+ await chrome.storage.local.remove("originalTabId");
+
chrome.tabs.update(originalTabId, { active: true });
sendMessageTab(originalTabId, { type: "LOGIN_SUCCESS" });
diff --git a/src/pages/Background/backup/initBackup.js b/src/pages/Background/backup/initBackup.js
index 5afca4e..0f7dae0 100644
--- a/src/pages/Background/backup/initBackup.js
+++ b/src/pages/Background/backup/initBackup.js
@@ -30,14 +30,14 @@ export const initBackup = async (request, id) => {
if (backupTab) {
chrome.tabs.get(backupTab, (tab) => {
- if (tab) {
+ if (chrome.runtime.lastError || !tab) {
+ createBackupTab();
+ } else {
sendMessageTab(tab.id, {
type: "init-backup",
request: request,
tabId: id,
});
- } else {
- createBackupTab();
}
});
} else {
diff --git a/src/pages/Background/drive/handleSaveToDrive.js b/src/pages/Background/drive/handleSaveToDrive.js
index df174a7..d443f94 100644
--- a/src/pages/Background/drive/handleSaveToDrive.js
+++ b/src/pages/Background/drive/handleSaveToDrive.js
@@ -1,6 +1,8 @@
import { base64ToUint8Array } from "../utils/base64ToUint8Array";
import { sendMessageTab } from "../tabManagement";
+import { chunksStore } from "../recording/chunkHandler";
import signIn from "../modules/signIn";
+import { diagEvent } from "../../utils/diagnosticLog";
const findOrCreateScreenityFolder = async (token) => {
const headers = new Headers({
@@ -17,6 +19,13 @@ const findOrCreateScreenityFolder = async (token) => {
{ headers }
);
+ if (!searchRes.ok) {
+ const text = await searchRes.text().catch(() => "");
+ throw new Error(
+ `Drive folder search failed: ${searchRes.status} ${text}`
+ );
+ }
+
const result = await searchRes.json();
if (result.files?.length) return result.files[0].id;
@@ -29,6 +38,13 @@ const findOrCreateScreenityFolder = async (token) => {
}),
});
+ if (!createRes.ok) {
+ const text = await createRes.text().catch(() => "");
+ throw new Error(
+ `Drive folder creation failed: ${createRes.status} ${text}`
+ );
+ }
+
const newFolder = await createRes.json();
return newFolder.id;
};
@@ -37,35 +53,57 @@ const getAuthTokenFromStorage = async () => {
return new Promise((resolve, reject) => {
chrome.storage.local.get(["token"], async (result) => {
if (chrome.runtime.lastError) {
+ console.error("[Drive] storage error:", chrome.runtime.lastError);
reject(new Error(chrome.runtime.lastError));
return;
}
const token = result.token;
if (!token) {
- const newToken = await signIn();
- if (!newToken) reject(new Error("Sign-in failed"));
- else resolve(newToken);
+ try {
+ const newToken = await signIn();
+ if (!newToken) {
+ console.error("[Drive] drive_auth_failed: signIn returned null");
+ diagEvent("drive-auth-fail", { reason: "signIn returned null" });
+ reject(new Error("Sign-in failed"));
+ } else {
+ resolve(newToken);
+ }
+ } catch (err) {
+ console.error("[Drive] drive_auth_failed:", err.message);
+ diagEvent("drive-auth-fail", { reason: String(err.message).slice(0, 80) });
+ reject(err);
+ }
return;
}
- let payload;
+ // Check JWT expiry if possible; opaque tokens skip this check.
+ let isExpired = false;
try {
- payload = JSON.parse(atob(token.split(".")[1]));
+ const parts = token.split(".");
+ if (parts.length === 3) {
+ const payload = JSON.parse(atob(parts[1]));
+ const exp = payload.exp * 1000;
+ isExpired = Date.now() >= exp;
+ }
+ // Not a JWT — skip expiry check
} catch {
- // Token is invalid, sign in again
- const newToken = await signIn();
- if (!newToken) reject(new Error("Sign-in failed"));
- else resolve(newToken);
- return;
+ // Not parseable — use as-is
}
- const exp = payload.exp * 1000;
- if (Date.now() >= exp) {
- // Token is expired, sign in again
- const newToken = await signIn();
- if (!newToken) reject(new Error("Sign-in failed"));
- else resolve(newToken);
+ if (isExpired) {
+ try {
+ const newToken = await signIn();
+ if (!newToken) {
+ console.error("[Drive] drive_auth_failed: re-sign-in returned null");
+ reject(new Error("Sign-in failed"));
+ } else {
+ resolve(newToken);
+ }
+ } catch (err) {
+ console.error("[Drive] drive_auth_failed:", err.message);
+ reject(err);
+ }
} else {
resolve(token);
}
@@ -78,6 +116,11 @@ const saveToDrive = async (videoBlob, fileName) => {
const token = await getAuthTokenFromStorage();
if (!token) throw new Error("Sign-in failed");
+ diagEvent("drive-upload-start", {
+ blobSize: videoBlob.size,
+ blobType: videoBlob.type,
+ });
+
const folderId = await findOrCreateScreenityFolder(token);
const metadata = {
@@ -91,8 +134,10 @@ const saveToDrive = async (videoBlob, fileName) => {
const reader = new FileReader();
- const base64Data = await new Promise((resolve) => {
+ const base64Data = await new Promise((resolve, reject) => {
reader.onload = (e) => resolve(e.target.result.split(",")[1]);
+ reader.onerror = () =>
+ reject(new Error("FileReader failed to read blob"));
reader.readAsDataURL(videoBlob);
});
@@ -119,26 +164,42 @@ const saveToDrive = async (videoBlob, fileName) => {
);
if (!uploadResponse.ok) {
- throw new Error(`Upload failed: ${uploadResponse.status}`);
+ const errBody = await uploadResponse.text().catch(() => "");
+ console.error("[Drive] drive_upload_failed", {
+ status: uploadResponse.status,
+ body: errBody,
+ });
+ throw new Error(`Upload failed: ${uploadResponse.status} ${errBody}`);
}
const { id: fileId } = await uploadResponse.json();
if (!fileId) throw new Error("File ID missing after upload");
+ diagEvent("drive-upload-ok", { fileId });
+
chrome.tabs.create({
url: `https://drive.google.com/file/d/${fileId}/view`,
});
return { status: "ok", url: fileId };
} catch (error) {
- console.error("Error uploading to Google Drive:", error.message);
- return { status: "ew", url: null };
+ console.error("[Drive] drive_upload_failed:", error.message);
+ diagEvent("drive-upload-fail", { error: String(error.message).slice(0, 120) });
+ return { status: "ew", url: null, error: error.message };
}
};
const savedToDrive = async () => {
const { sandboxTab } = await chrome.storage.local.get(["sandboxTab"]);
- sendMessageTab(sandboxTab, { type: "saved-to-drive" });
+ if (!sandboxTab) {
+ console.warn("[Drive] savedToDrive: sandboxTab not set, cannot notify UI");
+ return;
+ }
+ try {
+ await sendMessageTab(sandboxTab, { type: "saved-to-drive" });
+ } catch (err) {
+ console.warn("[Drive] savedToDrive: failed to notify sandbox tab:", err);
+ }
};
export const handleSaveToDrive = async (request, fallback = false) => {
@@ -147,29 +208,41 @@ export const handleSaveToDrive = async (request, fallback = false) => {
if (!fallback) {
const blob = base64ToUint8Array(request.base64);
- const fileName = request.title + ".mp4";
+ const ext = request.isWebm ? ".webm" : ".mp4";
+ const fileName = (request.title || "Screenity Recording") + ext;
response = await saveToDrive(blob, fileName);
} else {
+ // Build blob from IndexedDB chunks (viewer/recovery mode)
const chunks = [];
await chunksStore.iterate((value) => chunks.push(value));
- let array = [];
- let lastTimestamp = 0;
- for (const chunk of chunks) {
- if (chunk.timestamp < lastTimestamp) continue;
- lastTimestamp = chunk.timestamp;
- array.push(chunk.chunk);
+ if (chunks.length === 0) {
+ console.error("[Drive] drive_upload_failed: no chunks in IndexedDB");
+ return { status: "ew", url: null, error: "No recording data found" };
}
- const blob = new Blob(array, { type: "video/webm" });
- const fileName = request.title + ".webm";
+ // Sort to ensure correct order
+ chunks.sort((a, b) => {
+ const ta = a.timestamp ?? a.index ?? 0;
+ const tb = b.timestamp ?? b.index ?? 0;
+ return ta - tb;
+ });
+
+ const parts = chunks.map((c) =>
+ c.chunk instanceof Blob ? c.chunk : new Blob([c.chunk])
+ );
+ const blob = new Blob(parts, { type: "video/webm" });
+ const fileName = (request.title || "Screenity Recording") + ".webm";
response = await saveToDrive(blob, fileName);
}
- await savedToDrive();
+ if (response.status === "ok") {
+ await savedToDrive();
+ }
return response;
} catch (err) {
- console.error("handleSaveToDrive failed:", err);
- return { status: "ew", url: null };
+ console.error("[Drive] handleSaveToDrive failed:", err);
+ diagEvent("drive-save-fail", { error: String(err.message).slice(0, 120) });
+ return { status: "ew", url: null, error: err.message };
}
};
diff --git a/src/pages/Background/listeners/onActionButtonClickedListener.js b/src/pages/Background/listeners/onActionButtonClickedListener.js
index fda6c13..007ad2a 100644
--- a/src/pages/Background/listeners/onActionButtonClickedListener.js
+++ b/src/pages/Background/listeners/onActionButtonClickedListener.js
@@ -127,6 +127,19 @@ const openPlaygroundOrPopup = async (tab) => {
export const onActionButtonClickedListener = () => {
chrome.action.onClicked.addListener(async (tab) => {
try {
+ // Recover a previous recording whose editor failed to open (expires after 1h).
+ const { editorRecoveryUrl, editorRecoveryAt } = await chrome.storage.local.get(["editorRecoveryUrl", "editorRecoveryAt"]);
+ if (editorRecoveryUrl) {
+ const ageMs = Date.now() - (editorRecoveryAt || 0);
+ if (ageMs < 60 * 60 * 1000) {
+ await chrome.storage.local.remove(["editorRecoveryUrl", "editorRecoveryAt"]);
+ chrome.tabs.create({ url: editorRecoveryUrl, active: true });
+ return;
+ }
+ // Expired — clear and fall through to normal behavior
+ await chrome.storage.local.remove(["editorRecoveryUrl", "editorRecoveryAt"]);
+ }
+
const { recording, pendingRecording, restarting, recorderSession } =
await chrome.storage.local.get([
"recording",
diff --git a/src/pages/Background/listeners/onMessageExternalListener.js b/src/pages/Background/listeners/onMessageExternalListener.js
index 882b9ff..1626622 100644
--- a/src/pages/Background/listeners/onMessageExternalListener.js
+++ b/src/pages/Background/listeners/onMessageExternalListener.js
@@ -16,6 +16,13 @@ export const onMessageExternalListener = () => {
chrome.runtime.onMessageExternal.addListener(
async (message, sender, sendResponse) => {
if (message.type === "AUTH_SUCCESS" && message.token) {
+ // User explicitly chose to stay logged out — ignore incoming tokens
+ // until they initiate a login themselves.
+ const { stayLoggedOut } = await chrome.storage.local.get([
+ "stayLoggedOut",
+ ]);
+ if (stayLoggedOut) return true;
+
await chrome.storage.local.set({
screenityToken: message.token,
screenityUser: null,
@@ -40,6 +47,7 @@ export const onMessageExternalListener = () => {
await chrome.storage.local.set({
isLoggedIn: true,
wasLoggedIn: false,
+ stayLoggedOut: false,
screenityUser: auth.user,
isSubscribed: auth.subscribed,
proSubscription: auth.proSubscription,
diff --git a/src/pages/Background/listeners/onTabRemovedListener.js b/src/pages/Background/listeners/onTabRemovedListener.js
index 6890b1e..8dc0a47 100644
--- a/src/pages/Background/listeners/onTabRemovedListener.js
+++ b/src/pages/Background/listeners/onTabRemovedListener.js
@@ -1,4 +1,5 @@
import { sendMessageTab, clearEditorTabReference } from "../tabManagement";
+import { removeTab } from "../tabManagement/removeTab";
import { sendMessageRecord } from "../recording/sendMessageRecord";
import { diagEvent, endDiagSession } from "../../utils/diagnosticLog";
@@ -19,6 +20,7 @@ export const onTabRemovedListener = () => {
activeTab,
recorderSession,
editorTab,
+ sandboxTab,
} = await chrome.storage.local.get([
"recording",
"pendingRecording",
@@ -29,12 +31,41 @@ export const onTabRemovedListener = () => {
"activeTab",
"recorderSession",
"editorTab",
+ "sandboxTab",
]);
if (tabId === editorTab) {
await clearEditorTabReference("editor-tab-closed", { tabId });
}
+ // Editor/sandbox tab closed — close the orphaned recorder tab (pinned
+ // recorder.html) so it doesn't linger. stopRecording() opens editors as
+ // sandboxTab (not editorTab), so we must check both.
+ const isEditorOrSandbox = tabId === editorTab || tabId === sandboxTab;
+ if (isEditorOrSandbox) {
+ if (tabId === sandboxTab) {
+ chrome.storage.local.set({ sandboxTab: null });
+ }
+ const isStillRecording =
+ recording ||
+ (recorderSession && recorderSession.status === "recording");
+ if (!isStillRecording && recordingTab && recordingTab !== tabId) {
+ try {
+ const recTab = await chrome.tabs.get(recordingTab);
+ const recUrl = recTab?.url || "";
+ if (
+ recUrl.includes("recorder.html") ||
+ recUrl.includes("cloudrecorder.html")
+ ) {
+ removeTab(recordingTab);
+ }
+ } catch {
+ // Tab already gone
+ }
+ chrome.storage.local.set({ recordingTab: null });
+ }
+ }
+
const recordedTabId = tabRecordedID || recordingTab;
// Check both recording flag AND recorderSession
@@ -111,6 +142,12 @@ export const onTabRemovedListener = () => {
chrome.action.setIcon({ path: "assets/icon-34.png" });
}
+ // If the recorder tab (recorder.html) is closed after recording ends,
+ // clear the stale reference so it doesn't break the next recording start.
+ if (tabId === recordingTab && !isActivelyRecording && !pendingRecording) {
+ chrome.storage.local.set({ recordingTab: null });
+ }
+
// If recorder tab is closed before recording starts, clear pending UI state.
const pendingOnly =
pendingRecording && !isActivelyRecording && !restarting;
diff --git a/src/pages/Background/listeners/onTabUpdatedListener.js b/src/pages/Background/listeners/onTabUpdatedListener.js
index 64efe39..8cabf29 100644
--- a/src/pages/Background/listeners/onTabUpdatedListener.js
+++ b/src/pages/Background/listeners/onTabUpdatedListener.js
@@ -1,8 +1,73 @@
import { sendMessageTab } from "../tabManagement";
import { diagEvent } from "../../utils/diagnosticLog";
+import { videoReady } from "../recording/recordingHelpers";
+import { chunksStore } from "../recording/chunkHandler";
export const handleTabUpdate = async (tabId, changeInfo, tab) => {
try {
+ // React to URL changes EARLY (fires at navigation start, before the new
+ // page loads) so we can clear recording state before the new content
+ // script re-injects the region UI.
+ if (changeInfo.url) {
+ const {
+ recording,
+ tabRecordedID,
+ recorderSession,
+ customRegion,
+ recordingType,
+ restarting,
+ } = await chrome.storage.local.get([
+ "recording",
+ "tabRecordedID",
+ "recorderSession",
+ "customRegion",
+ "recordingType",
+ "restarting",
+ ]);
+
+ const isActivelyRecording =
+ recording ||
+ (recorderSession && recorderSession.status === "recording");
+ const isRegionRecording = customRegion || recordingType === "region";
+
+ if (
+ !restarting &&
+ isActivelyRecording &&
+ isRegionRecording &&
+ tabRecordedID &&
+ tabRecordedID === tabId
+ ) {
+ diagEvent("region-nav-stop", { tabId });
+ // Clear ALL recording state IMMEDIATELY so the new page's content
+ // script won't see an active recording, and so the status=complete
+ // handler won't send a recording-check that re-enables the UI.
+ // Also clear recordingTab so stopRecording() opens the editor
+ // instead of thinking it was already handled.
+ await chrome.storage.local.set({
+ recording: false,
+ customRegion: false,
+ recordingTab: null,
+ postStopEditorOpening: false,
+ postStopEditorOpened: false,
+ recorderSession: recorderSession
+ ? { ...recorderSession, status: "stopped" }
+ : null,
+ });
+ const chunkCount = await chunksStore.length().catch(() => 0);
+ if (chunkCount === 0) {
+ diagEvent("region-nav-no-chunks");
+ sendMessageTab(tabId, {
+ type: "show-toast",
+ message: chrome.i18n.getMessage("recordingTooShortToast"),
+ timeout: 5000,
+ }).catch(() => {});
+ return;
+ }
+ await videoReady();
+ return; // Skip the status=complete handler for this event
+ }
+ }
+
if (changeInfo.status === "complete") {
const {
recording,
@@ -14,6 +79,8 @@ export const handleTabUpdate = async (tabId, changeInfo, tab) => {
pendingRecording,
recordingStartTime,
recorderSession,
+ customRegion,
+ recordingType,
} = await chrome.storage.local.get([
"recording",
"paused",
@@ -24,6 +91,8 @@ export const handleTabUpdate = async (tabId, changeInfo, tab) => {
"pendingRecording",
"recordingStartTime",
"recorderSession",
+ "customRegion",
+ "recordingType",
]);
// Check both recording flag AND recorderSession to avoid race conditions
@@ -38,6 +107,8 @@ export const handleTabUpdate = async (tabId, changeInfo, tab) => {
} else if (isActivelyRecording) {
if (tabRecordedID && tabRecordedID === tabId) {
diagEvent("recorded-tab-navigated");
+
+ // For non-region recordings, send a check to the content script
sendMessageTab(tabId, {
type: "recording-check",
force: true,
diff --git a/src/pages/Background/messaging/handlers.js b/src/pages/Background/messaging/handlers.js
index 53855e9..68fe429 100644
--- a/src/pages/Background/messaging/handlers.js
+++ b/src/pages/Background/messaging/handlers.js
@@ -77,7 +77,7 @@ const APP_BASE = process.env.SCREENITY_APP_BASE;
const CLOUD_FEATURES_ENABLED =
process.env.SCREENITY_ENABLE_CLOUD_FEATURES === "true";
// Debug toggle for post-stop/chunk flow
-const DEBUG_POSTSTOP = true;
+const DEBUG_POSTSTOP = false;
const STOP_RECORDING_TAB_DEBOUNCE_MS = 1200;
const CLOUD_LOCAL_PLAYBACK_MAX_BYTES = 250 * 1024 * 1024;
const CLOUD_LOCAL_PLAYBACK_MAX_CHUNKS = 4000;
@@ -228,19 +228,17 @@ const ensureAudioOffscreen = async () => {
if (!chrome.offscreen) return false;
try {
const contexts = await chrome.runtime.getContexts({});
- const audioUrl = chrome.runtime.getURL("audiooffscreen.html");
- const hasAudioOffscreen = contexts.some(
- (context) =>
- context.contextType === "OFFSCREEN_DOCUMENT" &&
- context.documentUrl === audioUrl,
+ const hasAnyOffscreen = contexts.some(
+ (context) => context.contextType === "OFFSCREEN_DOCUMENT",
);
- if (!hasAudioOffscreen) {
- await chrome.offscreen.createDocument({
- url: "audiooffscreen.html",
- reasons: ["AUDIO_PLAYBACK"],
- justification: "Play short UI beep sounds.",
- });
- }
+ // If an offscreen document already exists (e.g. the recorder), reuse it
+ // — Chrome only allows one offscreen document per extension.
+ if (hasAnyOffscreen) return true;
+ await chrome.offscreen.createDocument({
+ url: "audiooffscreen.html",
+ reasons: ["AUDIO_PLAYBACK"],
+ justification: "Play short UI beep sounds.",
+ });
return true;
} catch (error) {
console.warn("Failed to ensure audio offscreen document", error);
@@ -375,7 +373,7 @@ const handleReopenPopupMulti = async () => {
}
};
-const handleCheckStorageQuota = async () => {
+const handleCheckStorageQuota = async (retried = false) => {
try {
const { screenityToken } = await chrome.storage.local.get("screenityToken");
@@ -387,6 +385,17 @@ const handleCheckStorageQuota = async () => {
credentials: "include",
});
+ // On 401, invalidate auth cache and retry once so loginWithWebsite()
+ // in the outer handler can refresh the token on the next attempt.
+ if (res.status === 401 && !retried) {
+ await chrome.storage.local.set({ lastAuthCheck: 0 });
+ const refresh = await loginWithWebsite();
+ if (refresh.authenticated) {
+ return handleCheckStorageQuota(true);
+ }
+ return { success: false, error: "Not authenticated" };
+ }
+
const result = await res.json();
if (!res.ok) {
@@ -721,6 +730,57 @@ export const setupHandlers = () => {
await videoReady(message);
await clearRecordingSessionSafe("video-ready");
});
+
+ // Fired by Region/Recorder.jsx pagehide — the iframe is being torn down
+ // because the user navigated away from the recorded tab.
+ registerMessage("region-iframe-destroyed", async () => {
+ const { recording, recorderSession, customRegion, recordingType } =
+ await chrome.storage.local.get([
+ "recording",
+ "recorderSession",
+ "customRegion",
+ "recordingType",
+ ]);
+ const isActivelyRecording =
+ recording ||
+ (recorderSession && recorderSession.status === "recording");
+ const isRegionRecording = customRegion || recordingType === "region";
+ if (!isActivelyRecording || !isRegionRecording) return;
+
+ diagEvent("region-iframe-destroyed");
+ await chrome.storage.local.set({
+ recording: false,
+ customRegion: false,
+ // Clear recordingTab so stopRecording() doesn't think the editor was
+ // already opened by the stop-recording-tab flow (recordingTab points
+ // to the pinned recorder.html tab which didn't open any editor).
+ recordingTab: null,
+ postStopEditorOpening: false,
+ postStopEditorOpened: false,
+ recorderSession: recorderSession
+ ? { ...recorderSession, status: "stopped" }
+ : null,
+ });
+
+ // If no chunks were persisted (user navigated almost immediately),
+ // show a toast instead of opening an empty editor.
+ const chunkCount = await chunksStore.length().catch(() => 0);
+ if (chunkCount === 0) {
+ diagEvent("region-nav-no-chunks");
+ const { activeTab } = await chrome.storage.local.get(["activeTab"]);
+ if (activeTab) {
+ sendMessageTab(activeTab, {
+ type: "show-toast",
+ message: chrome.i18n.getMessage("recordingTooShortToast"),
+ timeout: 5000,
+ }).catch(() => {});
+ }
+ return;
+ }
+
+ await videoReady();
+ });
+
registerMessage("start-recording", (message) => startRecording(message));
registerMessage("countdown-finished", async (message) => {
const { recording, restarting, pendingRecording } =
@@ -930,9 +990,18 @@ export const setupHandlers = () => {
});
registerMessage("set-mic-active-tab", (message) => setMicActiveTab(message));
- // Diagnostic events routed from content scripts
+ // Diagnostic events routed from content scripts / sandbox
registerMessage("diag-countdown-started", () => diagEvent("countdown-started"));
registerMessage("diag-countdown-cancelled", () => diagEvent("countdown-cancelled"));
+ registerMessage("diag-editor-ready", (message) =>
+ diagEvent("editor-load-ready", { path: message?.path || null }),
+ );
+ registerMessage("open-editor-recovery", async () => {
+ const { editorRecoveryUrl } = await chrome.storage.local.get(["editorRecoveryUrl"]);
+ if (!editorRecoveryUrl) return;
+ chrome.storage.local.remove(["editorRecoveryUrl", "editorRecoveryAt"]);
+ chrome.tabs.create({ url: editorRecoveryUrl, active: true });
+ });
registerMessage("recording-error", async (message) => {
await handleRecordingError(message);
await clearRecordingSessionSafe("recording-error", {
@@ -1048,6 +1117,38 @@ export const setupHandlers = () => {
});
createTab(`https://tally.so/r/3ElpXq?${qs}`, false, true);
});
+ registerMessage("report-error", async (message) => {
+ const errorCode = message?.errorCode || null;
+ const errorWhy = message?.errorWhy || null;
+ const source = message?.source || "error-modal";
+
+ // Check auth for form routing
+ let user = null;
+ let isLoggedIn = false;
+ if (CLOUD_FEATURES_ENABLED) {
+ try {
+ const auth = await loginWithWebsite();
+ if (auth.authenticated && auth.user) {
+ user = auth.user;
+ isLoggedIn = true;
+ }
+ } catch {}
+ }
+
+ const qs = await supportContextQuery({
+ includeRecordingState: true,
+ source,
+ errorCode,
+ errorWhy,
+ user: isLoggedIn ? { name: user.name, email: user.email } : undefined,
+ });
+
+ if (isLoggedIn) {
+ createTab(`https://tally.so/r/310MNg?extension=true&${qs}`, false, true);
+ } else {
+ createTab(`https://tally.so/r/3ElpXq?feedbackType=Bug&${qs}`, false, true);
+ }
+ });
registerMessage("clear-recordings", () => clearAllRecordings());
registerMessage("force-processing", (message) => forceProcessing(message));
registerMessage("focus-this-tab", (message, sender) =>
@@ -1173,6 +1274,9 @@ export const setupHandlers = () => {
console.warn("Cloud features disabled, cannot handle login");
return;
}
+ // User is explicitly initiating login — clear the stay-logged-out flag.
+ await chrome.storage.local.set({ stayLoggedOut: false });
+
const currentTab = await getCurrentTab();
if (currentTab?.id) {
@@ -1198,9 +1302,11 @@ export const setupHandlers = () => {
]);
// Preserve a post-logout marker so popup can render the LoggedOut state.
+ // stayLoggedOut blocks auto-login until the user explicitly clicks "Log in".
await chrome.storage.local.set({
isLoggedIn: false,
wasLoggedIn: true,
+ stayLoggedOut: true,
isSubscribed: false,
proSubscription: null,
screenityUser: null,
@@ -1367,7 +1473,8 @@ export const setupHandlers = () => {
sendResponse({ success: false, error: "Cloud features disabled" });
return true;
}
- const { authenticated, subscribed } = await loginWithWebsite();
+ const authResult = await loginWithWebsite();
+ const { authenticated, subscribed } = authResult;
if (!authenticated) {
sendResponse({ success: false, error: "Not authenticated" });
@@ -1870,6 +1977,19 @@ export const setupHandlers = () => {
registerMessage("clear-recording-alarm", async () => {
await chrome.alarms.clear("recording-alarm");
});
+ // Relay toasts to the active content script (extension pages can't reach it directly).
+ registerMessage("show-toast", async (message) => {
+ try {
+ const { activeTab } = await chrome.storage.local.get(["activeTab"]);
+ if (activeTab) {
+ sendMessageTab(activeTab, {
+ type: "show-toast",
+ message: message.message,
+ timeout: message.timeout,
+ }).catch(() => {});
+ }
+ } catch {}
+ });
registerMessage("get-tab-id", (message, sender, sendResponse) => {
sendResponse({ tabId: sender?.tab?.id ?? null });
return true;
diff --git a/src/pages/Background/modules/signIn.js b/src/pages/Background/modules/signIn.js
index 5e844af..9c77893 100644
--- a/src/pages/Background/modules/signIn.js
+++ b/src/pages/Background/modules/signIn.js
@@ -22,11 +22,13 @@ const signInEdge = async () => {
},
async (redirectUrl) => {
if (chrome.runtime.lastError) {
+ console.error("[Drive] drive_auth_failed: Edge auth error:", chrome.runtime.lastError.message);
reject(new Error(chrome.runtime.lastError.message));
return;
}
if (!redirectUrl) {
+ console.error("[Drive] drive_auth_failed: no redirect URL (user cancelled?)");
reject(new Error("User cancelled sign-in or failed to get token"));
return;
}
@@ -37,6 +39,7 @@ const signInEdge = async () => {
const token = params.get("access_token");
if (!token) {
+ console.error("[Drive] drive_auth_failed: no access_token in redirect");
reject(new Error("Failed to extract token from redirect"));
return;
}
@@ -56,6 +59,7 @@ const signInChrome = async () => {
const token = await chrome.identity.getAuthToken({ interactive: true });
if (!token) {
+ console.error("[Drive] drive_auth_failed: getAuthToken returned null");
throw new Error("User cancelled sign-in or failed to get token");
}
@@ -64,8 +68,6 @@ const signInChrome = async () => {
chrome.storage.local.set({ token: token.token }, () => resolve())
);
- //const userInfo = await chrome.identity.getProfileUserInfo();
-
return token.token;
};
@@ -77,7 +79,7 @@ const signIn = async () => {
return await signInChrome();
}
} catch (error) {
- console.error("Error signing in:", error.message);
+ console.error("[Drive] drive_auth_failed:", error.message);
return null;
}
};
diff --git a/src/pages/Background/offscreen/offscreenDocument.js b/src/pages/Background/offscreen/offscreenDocument.js
index c171bf8..96ca3d5 100644
--- a/src/pages/Background/offscreen/offscreenDocument.js
+++ b/src/pages/Background/offscreen/offscreenDocument.js
@@ -1,4 +1,5 @@
import { getCurrentTab } from "../tabManagement";
+import { removeTab } from "../tabManagement/removeTab";
import { sendMessageRecord } from "../recording/sendMessageRecord.js";
import { closeOffscreenDocument } from "./closeOffscreenDocument.js";
import { loginWithWebsite } from "../auth/loginWithWebsite.js";
@@ -13,12 +14,11 @@ const openRecorderTab = async (
let switchTab = true;
// Check subscription status
- const { authenticated, subscribed } = await loginWithWebsite();
+ const { authenticated, subscribed, cached, transient, error: authError } = await loginWithWebsite();
const recorderUrl =
authenticated && subscribed
? chrome.runtime.getURL("cloudrecorder.html")
: chrome.runtime.getURL("recorder.html");
-
if (!isRegion) {
if (camera) {
switchTab = false;
@@ -29,6 +29,29 @@ const openRecorderTab = async (
);
}
+ // Close any leftover recorder tab from a previous recording so we don't
+ // end up with two pinned tabs. Only close actual extension recorder pages —
+ // for region recordings, recordingTab can temporarily point to the user's
+ // active page, which we must NOT close.
+ const { recordingTab: prevRecTab } = await chrome.storage.local.get([
+ "recordingTab",
+ ]);
+ if (prevRecTab != null) {
+ try {
+ const prevTab = await chrome.tabs.get(prevRecTab);
+ const prevUrl = prevTab?.url || "";
+ if (
+ prevUrl.includes("recorder.html") ||
+ prevUrl.includes("cloudrecorder.html")
+ ) {
+ await removeTab(prevRecTab);
+ }
+ } catch {
+ // Tab doesn't exist — just clear the reference
+ }
+ chrome.storage.local.set({ recordingTab: null });
+ }
+
chrome.tabs
.create({
url: recorderUrl,
@@ -39,7 +62,20 @@ const openRecorderTab = async (
})
.then((tab) => {
// Prevent Chrome from discarding this tab during recording
- chrome.tabs.update(tab.id, { autoDiscardable: false }).catch(() => {});
+ chrome.tabs.update(tab.id, { autoDiscardable: false }).catch((err) => {
+ console.warn(
+ "[Screenity] autoDiscardable failed for recorder tab",
+ tab.id,
+ String(err),
+ );
+ chrome.storage.local.set({
+ lastAutoDiscardableError: {
+ ts: Date.now(),
+ tabId: tab.id,
+ error: String(err),
+ },
+ });
+ });
chrome.storage.local.set({
recordingTab: tab.id,
diff --git a/src/pages/Background/recording/checkRecording.js b/src/pages/Background/recording/checkRecording.js
index 952b170..03b94db 100644
--- a/src/pages/Background/recording/checkRecording.js
+++ b/src/pages/Background/recording/checkRecording.js
@@ -10,7 +10,7 @@ export const checkRecording = async () => {
if (recordingTab && !offscreen) {
try {
chrome.tabs.get(recordingTab, (tab) => {
- if (!tab) {
+ if (chrome.runtime.lastError || !tab) {
discardRecording();
}
});
diff --git a/src/pages/Background/recording/recordingHelpers.js b/src/pages/Background/recording/recordingHelpers.js
index 1e7498e..3d6f435 100644
--- a/src/pages/Background/recording/recordingHelpers.js
+++ b/src/pages/Background/recording/recordingHelpers.js
@@ -10,6 +10,7 @@ import { addAlarmListener } from "../alarms/addAlarmListener";
import { getStreamingData } from "./getStreamingData";
import { discardOffscreenDocuments } from "../offscreen/discardOffscreenDocuments";
import { diagEvent, endDiagSession } from "../../utils/diagnosticLog";
+import { classifyError } from "../../utils/errorCodes";
export const checkCapturePermissions = async ({ isLoggedIn, isSubscribed }) => {
const permissions = ["desktopCapture", "alarms", "offscreen"];
@@ -65,30 +66,42 @@ export const handleRecordingComplete = async () => {
if (recordingTab) {
chrome.tabs.get(recordingTab, (tab) => {
- if (tab) {
- // Check if tab url contains chrome-extension and recorder.html
- if (
- tab.url.includes("chrome-extension") &&
- tab.url.includes("recorder.html")
- ) {
- // FLAG: For testing purposes -> comment to debug
- removeTab(recordingTab);
- }
+ if (chrome.runtime.lastError || !tab) return;
+ // Check if tab url contains chrome-extension and recorder.html
+ if (
+ tab.url.includes("chrome-extension") &&
+ tab.url.includes("recorder.html")
+ ) {
+ // FLAG: For testing purposes -> comment to debug
+ removeTab(recordingTab);
}
});
}
+ // Clear so subsequent recordings don't conflict
+ chrome.storage.local.set({ recordingTab: null });
};
export const handleRecordingError = async (request) => {
if (globalThis.SCREENITY_VERBOSE_LOGS) {
console.log("handleRecordingError called with request:", request);
}
+
+ // Propagate or derive error code
+ const errorCode =
+ request?.errorCode ||
+ classifyError(request?.why || "", request?.error || "");
+
try {
+ const { recordingAttemptId } = await chrome.storage.local.get([
+ "recordingAttemptId",
+ ]);
await chrome.storage.local.set({
lastRecordingError: {
ts: Date.now(),
error: request?.error || null,
why: request?.why || null,
+ errorCode,
+ recordingAttemptId: recordingAttemptId || null,
},
});
} catch {}
@@ -107,6 +120,7 @@ export const handleRecordingError = async (request) => {
diagEvent(isWarningOnly ? "warning" : "error", {
error: request?.error || null,
why: request?.why || null,
+ errorCode,
});
// For stream-ended, we just notify the user but DON'T stop the recording
@@ -114,8 +128,10 @@ export const handleRecordingError = async (request) => {
if (isWarningOnly) {
sendMessageTab(activeTab, {
type: "stream-ended-warning",
- message: request.why || "Screen sharing stopped unexpectedly.",
- }).catch(() => {});
+ message: request.why || chrome.i18n.getMessage("streamEndedWarningToast"),
+ }).catch((err) => {
+ diagEvent("warning", { note: "stream-ended-warning undelivered", err: String(err).slice(0, 80) });
+ });
return; // Don't continue with the normal error handling
}
@@ -132,7 +148,9 @@ export const handleRecordingError = async (request) => {
type: "clear-recording-session-safe",
reason: "recording-error-terminal",
})
- .catch(() => {});
+ .catch((err) => {
+ diagEvent("warning", { note: "clear-session-safe undelivered", err: String(err).slice(0, 80) });
+ });
sendMessageRecord({ type: "recording-error" }).then(() => {
const candidateTabs = [activeTab, recordingUiTabId, tabRecordedID].filter(
@@ -143,9 +161,9 @@ export const handleRecordingError = async (request) => {
});
focusTab(activeTab);
if (request.error === "stream-error") {
- sendMessageTab(activeTab, { type: "stream-error" });
+ sendMessageTab(activeTab, { type: "stream-error", errorCode });
} else if (request.error === "backup-error") {
- sendMessageTab(activeTab, { type: "backup-error" });
+ sendMessageTab(activeTab, { type: "backup-error", errorCode });
}
});
@@ -174,8 +192,10 @@ export const videoReady = async () => {
type: "clear-recording-session-safe",
reason: "video-ready-terminal",
})
- .catch(() => {});
- stopRecording();
+ .catch((err) => {
+ diagEvent("warning", { note: "clear-session-safe undelivered (video-ready)", err: String(err).slice(0, 80) });
+ });
+ await stopRecording();
};
export const writeFile = async (request) => {
diff --git a/src/pages/Background/recording/sendMessageRecord.js b/src/pages/Background/recording/sendMessageRecord.js
index bf43cd3..7e53587 100644
--- a/src/pages/Background/recording/sendMessageRecord.js
+++ b/src/pages/Background/recording/sendMessageRecord.js
@@ -23,9 +23,12 @@ export const sendMessageRecord = (message, responseCallback = null) => {
sendMessageTab(result.recordingTab, message, responseCallback)
.then(resolve)
.catch((err) => {
+ const errStr = String(err);
+ const isDeadTab =
+ errStr.includes("Receiving end does not exist") ||
+ errStr.includes("No tab with id");
console.warn(
- "sendMessageRecord: failed to message recordingTab",
- result.recordingTab,
+ `sendMessageRecord: failed to message recordingTab ${result.recordingTab}${isDeadTab ? " (stale/dead tab)" : ""}`,
err
);
reject(err);
diff --git a/src/pages/Background/recording/startRecording.js b/src/pages/Background/recording/startRecording.js
index cfed4c2..1ade7f1 100644
--- a/src/pages/Background/recording/startRecording.js
+++ b/src/pages/Background/recording/startRecording.js
@@ -1,9 +1,14 @@
import { sendMessageRecord } from "./sendMessageRecord";
+import { sendMessageTab } from "../tabManagement";
import { initDiagSession, diagEvent } from "../../utils/diagnosticLog";
+import { makeRecordingAttemptId } from "../../utils/errorCodes";
export const startRecording = async () => {
+ // Correlation ID for this recording attempt
+ const recordingAttemptId = makeRecordingAttemptId();
chrome.storage.local.set({
restarting: false,
+ recordingAttemptId,
});
const { activeTab, recordingUiTabId } = await chrome.storage.local.get([
@@ -69,6 +74,7 @@ export const startRecording = async () => {
"countdown",
]);
await initDiagSession({
+ recordingAttemptId,
recordingType: recordingType || "screen",
quality: quality || null,
region: Boolean(customRegion),
@@ -84,51 +90,51 @@ export const startRecording = async () => {
// the event is flushed to storage before the SW can be killed.
diagEvent("session-start", { region: Boolean(customRegion) });
- if (customRegion) {
- sendMessageRecord({ type: "start-recording-tab", region: true })
- .then(() => {
- chrome.storage.local.set({
- lastStartRecordingDispatch: {
- ts: Date.now(),
- ok: true,
- region: true,
- },
- });
- })
- .catch((err) => {
- chrome.storage.local.set({
- lastStartRecordingDispatch: {
- ts: Date.now(),
- ok: false,
- region: true,
- error: String(err),
- },
- });
- diagEvent("start-fail", { region: true, error: String(err) });
- });
- } else {
- sendMessageRecord({ type: "start-recording-tab" })
- .then(() => {
- chrome.storage.local.set({
- lastStartRecordingDispatch: {
- ts: Date.now(),
- ok: true,
- region: false,
- },
- });
- })
- .catch((err) => {
- chrome.storage.local.set({
- lastStartRecordingDispatch: {
- ts: Date.now(),
- ok: false,
- region: false,
- error: String(err),
- },
- });
- diagEvent("start-fail", { region: false, error: String(err) });
- });
+ // If recordingTab points to a dead tab left over from a previous recording,
+ // clear it so sendMessageRecord doesn't try to message it.
+ const { recordingTab: prevRecTab } = await chrome.storage.local.get([
+ "recordingTab",
+ ]);
+ if (prevRecTab != null) {
+ try {
+ await chrome.tabs.get(prevRecTab);
+ // Tab is alive — this is the current recorder tab, leave it alone.
+ } catch {
+ // Tab doesn't exist — stale reference from a previous recording.
+ diagEvent("stale-recording-tab-cleared", { prevRecTab });
+ chrome.storage.local.set({ recordingTab: null });
+ }
}
+
+ const startMsg = customRegion
+ ? { type: "start-recording-tab", region: true }
+ : { type: "start-recording-tab" };
+
+ sendMessageRecord(startMsg).catch((err) => {
+ const errStr = String(err).slice(0, 120);
+ const isStaleTab =
+ errStr.includes("Receiving end does not exist") ||
+ errStr.includes("No tab with id") ||
+ errStr.includes("No recording tab available");
+ diagEvent("start-fail", {
+ region: Boolean(customRegion),
+ error: errStr,
+ staleTab: isStaleTab,
+ });
+ // Notify the user that the recording failed to start
+ chrome.storage.local.get(["activeTab"], ({ activeTab }) => {
+ if (activeTab) {
+ sendMessageTab(activeTab, {
+ type: "recording-error",
+ error: "start-failed",
+ why: isStaleTab
+ ? "stale-recorder-tab"
+ : "recorder-tab-unavailable",
+ }).catch(() => {});
+ }
+ });
+ chrome.action.setIcon({ path: "assets/icon-34.png" });
+ });
chrome.action.setIcon({ path: "assets/recording-logo.png" });
// Set up alarm if set in storage
if (alarm) {
diff --git a/src/pages/Background/recording/stopRecording.js b/src/pages/Background/recording/stopRecording.js
index 529c3f0..10f2986 100644
--- a/src/pages/Background/recording/stopRecording.js
+++ b/src/pages/Background/recording/stopRecording.js
@@ -19,13 +19,40 @@ const acquirePostStopEditorLock = async (recordingId = null) => {
};
const releasePostStopEditorLock = async (overrides = {}) => {
+ // Only clear the "in-progress" flag. Keep postStopEditorOpened=true so
+ // stopRecording() (which runs later) still knows an editor was opened and
+ // won't open a duplicate. stopRecording() clears postStopEditorOpened itself.
await chrome.storage.local.set({
postStopEditorOpening: false,
- postStopEditorOpened: false,
...overrides,
});
};
+/** Store a recovery URL and toast the user when the editor tab fails to open. */
+const handleEditorOpenFailed = async (editorUrl, lastError) => {
+ diagEvent("editor-open-failed", {
+ editorUrl,
+ lastError: lastError || "tab-create-failed",
+ });
+ await chrome.storage.local.set({
+ editorRecoveryUrl: editorUrl,
+ editorRecoveryAt: Date.now(),
+ });
+ // Toast the active tab
+ try {
+ const { activeTab } = await chrome.storage.local.get(["activeTab"]);
+ if (activeTab) {
+ sendMessageTab(activeTab, {
+ type: "show-toast",
+ message: chrome.i18n.getMessage("editorRecoveryToast"),
+ timeout: 12000,
+ }).catch(() => {});
+ }
+ } catch (_) {
+ // Recovery URL is still in storage either way
+ }
+};
+
export const stopRecording = async () => {
chrome.action.setIcon({ path: "assets/icon-34.png" });
chrome.storage.local.set({ restarting: false });
@@ -111,7 +138,7 @@ export const stopRecording = async () => {
chrome.alarms.clear("recording-alarm");
discardOffscreenDocuments();
chrome.storage.local.remove(["recordingMeta"]);
- } else if (postStopEditorOpening || postStopEditorOpened || recordingTab) {
+ } else if (postStopEditorOpening || postStopEditorOpened) {
// Editor already opened by stop-recording-tab flow; avoid opening a second tab.
// That flow will trigger processing when the tab finishes loading.
} else if (hasWebCodecs) {
@@ -120,9 +147,14 @@ export const stopRecording = async () => {
const query = postStopRecordingId
? `?mode=postStop&recordingId=${encodeURIComponent(postStopRecordingId)}`
: "?mode=postStop";
+ const wcUrl = `editorwebcodecs.html${query}`;
chrome.tabs.create(
- { url: `editorwebcodecs.html${query}`, active: true },
+ { url: wcUrl, active: true },
(tab) => {
+ if (chrome.runtime.lastError || !tab?.id) {
+ handleEditorOpenFailed(wcUrl, chrome.runtime.lastError?.message);
+ return;
+ }
chrome.tabs.onUpdated.addListener(function _(
tabId,
changeInfo,
@@ -152,9 +184,14 @@ export const stopRecording = async () => {
const query = postStopRecordingId
? `?mode=postStop&recordingId=${encodeURIComponent(postStopRecordingId)}`
: "?mode=postStop";
+ const viewerUrl = `editorviewer.html${query}`;
chrome.tabs.create(
- { url: `editorviewer.html${query}`, active: true },
+ { url: viewerUrl, active: true },
(tab) => {
+ if (chrome.runtime.lastError || !tab?.id) {
+ handleEditorOpenFailed(viewerUrl, chrome.runtime.lastError?.message);
+ return;
+ }
chrome.tabs.onUpdated.addListener(function _(
tabId,
changeInfo,
@@ -183,7 +220,12 @@ export const stopRecording = async () => {
const query = postStopRecordingId
? `?mode=postStop&recordingId=${encodeURIComponent(postStopRecordingId)}`
: "?mode=postStop";
- chrome.tabs.create({ url: `editor.html${query}`, active: true }, (tab) => {
+ const ffmpegUrl = `editor.html${query}`;
+ chrome.tabs.create({ url: ffmpegUrl, active: true }, (tab) => {
+ if (chrome.runtime.lastError || !tab?.id) {
+ handleEditorOpenFailed(ffmpegUrl, chrome.runtime.lastError?.message);
+ return;
+ }
chrome.tabs.onUpdated.addListener(function _(
tabId,
changeInfo,
@@ -207,6 +249,14 @@ export const stopRecording = async () => {
chrome.runtime.sendMessage({ type: "turn-off-pip" });
}
+ // NOTE: Do NOT clear recordingTab here. The pinned recorder tab may still
+ // be alive and is cleaned up by:
+ // - handleRecordingComplete() when the editor finishes processing
+ // - onTabRemoved when the user closes the editor (which closes the recorder tab)
+ // - openRecorderTab() as a safety net before creating a new recorder tab
+ // Clearing the reference here would orphan the tab because later cleanup
+ // relies on the reference to find and close it.
+
// End the diagnostic session for all paths (subscriber, free webcodecs,
// free viewer, free ffmpeg, and already-opened-editor). Error/crash paths
// end the session separately via their own endDiagSession calls.
@@ -217,6 +267,11 @@ export const stopRecording = async () => {
chrome.storage.local.set({ wasRegion: false, region: true });
}
+ // Clear the "editor was opened" flag so it doesn't bleed into the next
+ // recording session. handleStopRecordingTab sets this; releasePostStopEditorLock
+ // intentionally preserves it so we can detect duplicates above.
+ chrome.storage.local.set({ postStopEditorOpened: false });
+
chrome.alarms.clear("recording-alarm");
discardOffscreenDocuments();
};
@@ -224,7 +279,11 @@ export const stopRecording = async () => {
export const handleStopRecordingTab = async (request) => {
chrome.action.setIcon({ path: "assets/icon-34.png" });
if (request.memoryError) {
- diagEvent("error", { type: "memory-error" });
+ diagEvent("error", {
+ type: "memory-error",
+ reason: request.reason || null,
+ savedChunks: request.savedChunks ?? null,
+ });
chrome.storage.local.set({
recording: false,
restarting: false,
@@ -304,13 +363,22 @@ export const handleStopRecordingTab = async (request) => {
},
(tab) => {
if (chrome.runtime.lastError || !tab?.id) {
- console.error(
- "❌ Failed to open post-stop editor:",
- chrome.runtime.lastError?.message || "tab-create-failed",
- );
+ const errMsg = chrome.runtime.lastError?.message || "tab-create-failed";
+ console.error("❌ Failed to open post-stop editor:", errMsg);
releasePostStopEditorLock({ postStopRecordingId: null });
+ const fullUrl = `${editorUrl}?mode=postStop&recordingId=${encodeURIComponent(recordingId)}`;
+ handleEditorOpenFailed(fullUrl, errMsg);
return;
}
+ let settled = false;
+ const safetyTimer = setTimeout(() => {
+ if (!settled) {
+ settled = true;
+ console.warn("[Screenity][BG] Editor tab load timed out — releasing lock");
+ diagEvent("editor-open-timeout", { tabId: tab.id, type: "editorwebcodecs" });
+ releasePostStopEditorLock();
+ }
+ }, 15000);
chrome.tabs.onUpdated.addListener(function _(
tabId,
changeInfo,
@@ -318,6 +386,9 @@ export const handleStopRecordingTab = async (request) => {
) {
if (tabId === tab.id && changeInfo.status === "complete") {
chrome.tabs.onUpdated.removeListener(_);
+ if (settled) return;
+ settled = true;
+ clearTimeout(safetyTimer);
chrome.storage.local.set({ sandboxTab: tab.id });
releasePostStopEditorLock();
sendMessageTab(tab.id, { type: "fallback-recording" }).catch(
@@ -339,13 +410,21 @@ export const handleStopRecordingTab = async (request) => {
// MediaRecorder/FFmpeg path: open editor normally (no postStop gating)
chrome.tabs.create({ url: editorUrl, active: true }, (tab) => {
if (chrome.runtime.lastError || !tab?.id) {
- console.error(
- "❌ Failed to open post-stop editor:",
- chrome.runtime.lastError?.message || "tab-create-failed",
- );
+ const errMsg = chrome.runtime.lastError?.message || "tab-create-failed";
+ console.error("❌ Failed to open post-stop editor:", errMsg);
releasePostStopEditorLock({ postStopRecordingId: null });
+ handleEditorOpenFailed(editorUrl, errMsg);
return;
}
+ let settled = false;
+ const safetyTimer = setTimeout(() => {
+ if (!settled) {
+ settled = true;
+ console.warn("[Screenity][BG] Editor tab load timed out — releasing lock");
+ diagEvent("editor-open-timeout", { tabId: tab.id, type: editorUrl });
+ releasePostStopEditorLock({ postStopRecordingId: null });
+ }
+ }, 15000);
chrome.tabs.onUpdated.addListener(function _(
tabId,
changeInfo,
@@ -353,6 +432,9 @@ export const handleStopRecordingTab = async (request) => {
) {
if (tabId === tab.id && changeInfo.status === "complete") {
chrome.tabs.onUpdated.removeListener(_);
+ if (settled) return;
+ settled = true;
+ clearTimeout(safetyTimer);
chrome.storage.local.set({
sandboxTab: tab.id,
postStopRecordingId: null,
@@ -402,7 +484,33 @@ export const handleStopRecordingTab = async (request) => {
}
}
- sendMessageRecord({ type: "stop-recording-tab" });
+ // Send stop to recorder; toast if the recorder tab doesn't ack.
+ (async () => {
+ const STOP_ACK_TIMEOUT_MS = 3000;
+ try {
+ const ack = await Promise.race([
+ sendMessageRecord({ type: "stop-recording-tab" }),
+ new Promise((_, reject) =>
+ setTimeout(() => reject(new Error("stop-ack-timeout")), STOP_ACK_TIMEOUT_MS)
+ ),
+ ]);
+ if (!ack || ack.ok !== true) throw new Error("stop-no-ack");
+ } catch (err) {
+ diagEvent("stop-ack-failed", { error: String(err).slice(0, 120) });
+ try {
+ const { activeTab } = await chrome.storage.local.get(["activeTab"]);
+ if (activeTab) {
+ sendMessageTab(activeTab, {
+ type: "show-toast",
+ message: chrome.i18n.getMessage("stopAckTimeoutToast"),
+ timeout: 8000,
+ }).catch(() => {});
+ }
+ } catch (_) {
+ // Toast failed — non-fatal
+ }
+ }
+ })();
};
export const handleStopRecordingTabBackup = async (request) => {
diff --git a/src/pages/Background/tabManagement/resetActiveTab.js b/src/pages/Background/tabManagement/resetActiveTab.js
index e9ced40..6a8d62e 100644
--- a/src/pages/Background/tabManagement/resetActiveTab.js
+++ b/src/pages/Background/tabManagement/resetActiveTab.js
@@ -15,13 +15,11 @@ export const restartActiveTab = async (message = {}) => {
sendMessageTab(targetTabId, { type: "ready-to-record" });
const { countdown } = await chrome.storage.local.get(["countdown"]);
- const delay = countdown ? null : 300;
- if (delay != null) {
- setTimeout(() => {
- startRecording();
- }, delay);
+ if (!countdown) {
+ startRecording();
}
+ // With countdown, content shows the UI and sends "countdown-finished".
} else {
console.error("No active tab found.");
}
@@ -73,13 +71,14 @@ export const resetActiveTab = async (forceRestart = false, message = {}) => {
sendMessageTab(targetTabId, { type: "ready-to-record" });
const { countdown } = await chrome.storage.local.get(["countdown"]);
- const delay = countdown ? null : 300;
- if (delay != null) {
- setTimeout(() => {
- startRecording();
- }, delay);
+ if (!countdown) {
+ // No countdown — start immediately. The recorder's readiness gate
+ // will wait for the stream to be live before actually recording.
+ startRecording();
}
+ // With countdown: Content shows the countdown UI and sends
+ // "countdown-finished" when done, which triggers startAfterCountdown().
} else {
console.error("No valid tab to send message to.");
}
diff --git a/src/pages/CloudRecorder/CloudRecorder.jsx b/src/pages/CloudRecorder/CloudRecorder.jsx
index 9def0d7..695c927 100644
--- a/src/pages/CloudRecorder/CloudRecorder.jsx
+++ b/src/pages/CloudRecorder/CloudRecorder.jsx
@@ -2656,16 +2656,6 @@ const CloudRecorder = () => {
await ensureAudioChunkStoreReady();
await ensureCameraChunkStoreReady();
- const pinned = await chrome.runtime
- .sendMessage({ type: "is-pinned" })
- .catch(() => true);
- if (pinned === false) {
- sendRecordingError(
- "Screenity must stay pinned to record. Pin the extension and try again.",
- );
- return;
- }
-
if (!uploadersInitialized.current) {
sendRecordingError(
"Uploaders not initialized. Please restart recording.",
@@ -4988,6 +4978,8 @@ const CloudRecorder = () => {
} else if (request.type === "stop-recording-tab") {
if (!isInit.current) return;
stopRecording(true, request.reason || "message-stop");
+ sendResponse?.({ ok: true });
+ return true;
} else if (request.type === "set-mic-active-tab") {
if (!isInit.current) return;
setMic(request);
diff --git a/src/pages/CloudRecorder/bunnyTusUploader.js b/src/pages/CloudRecorder/bunnyTusUploader.js
index fe99191..a9e8764 100644
--- a/src/pages/CloudRecorder/bunnyTusUploader.js
+++ b/src/pages/CloudRecorder/bunnyTusUploader.js
@@ -706,7 +706,7 @@ export default class BunnyTusUploader {
method: "POST",
headers: {
"Content-Type": "application/json",
- Authorization: `Bearer ${user.token}`,
+ Authorization: `Bearer ${screenityToken}`,
},
body: JSON.stringify({
title,
@@ -785,8 +785,12 @@ export default class BunnyTusUploader {
}
async refreshTusAuth() {
+ // Prefer stored screenityToken for auth
+ const token = this.userToken || (await chrome.storage.local.get(["screenityToken"]).then(r => r.screenityToken));
+ const headers = token ? { Authorization: `Bearer ${token}` } : {};
const res = await fetch(
`${API_BASE}/bunny/videos/tus-auth?videoId=${this.videoId}`,
+ { headers },
);
if (!res.ok) throw new Error("Failed to refresh TUS auth");
const { signature, expires, libraryId } = await res.json();
@@ -819,7 +823,7 @@ export default class BunnyTusUploader {
: location;
if (this.userToken) {
- await fetch(`${API_BASE}/bunny/videos/save-upload-meta`, {
+ fetch(`${API_BASE}/bunny/videos/save-upload-meta`, {
method: "POST",
headers: {
"Content-Type": "application/json",
@@ -835,7 +839,9 @@ export default class BunnyTusUploader {
recordingSessionId: this.sessionId || null,
type: this.metadata?.type || null,
}),
- });
+ }).catch((err) =>
+ this.debugLog("save-upload-meta failed (non-blocking)", { error: String(err) }),
+ );
} else {
this.debugLog("Skipping save-upload-meta because user token is missing", {
mediaId: this.mediaId,
diff --git a/src/pages/CloudRecorder/messaging.js b/src/pages/CloudRecorder/messaging.js
index 8c5ca01..2f9e050 100644
--- a/src/pages/CloudRecorder/messaging.js
+++ b/src/pages/CloudRecorder/messaging.js
@@ -1,3 +1,5 @@
+import { classifyError } from "../utils/errorCodes";
+
const urlParams = new URLSearchParams(window.location.search);
const IS_INJECTED_IFRAME = urlParams.has("injected");
const IS_IFRAME_CONTEXT =
@@ -6,10 +8,15 @@ const IS_IFRAME_CONTEXT =
!document.referrer.startsWith("chrome-extension://"));
export function sendRecordingError(why, cancel = false) {
+ const errorType = !cancel ? "stream-error" : "cancel-modal";
+ const whyStr = typeof why === "string" ? why : JSON.stringify(why);
+ const errorCode = classifyError(whyStr, errorType);
+
chrome.runtime.sendMessage({
type: "recording-error",
- error: !cancel ? "stream-error" : "cancel-modal",
- why: typeof why === "string" ? why : JSON.stringify(why),
+ error: errorType,
+ why: whyStr,
+ errorCode,
});
if (IS_IFRAME_CONTEXT) {
diff --git a/src/pages/Content/Content.jsx b/src/pages/Content/Content.jsx
index f0523c1..7411b1f 100644
--- a/src/pages/Content/Content.jsx
+++ b/src/pages/Content/Content.jsx
@@ -67,63 +67,36 @@ const Content = () => {
}
.screenity-shadow-dom .TooltipContent[data-state='delayed-open'][data-side='top'] {
- animation-name: slideDownAndFade;
+ animation-name: screenity-slideDownAndFade;
}
.screenity-shadow-dom .TooltipContent[data-state='delayed-open'][data-side='right'] {
- animation-name: slideLeftAndFade;
+ animation-name: screenity-slideLeftAndFade;
}
.screenity-shadow-dom.TooltipContent[data-state='delayed-open'][data-side='bottom'] {
- animation-name: slideUpAndFade;
+ animation-name: screenity-slideUpAndFade;
}
.screenity-shadow-dom.TooltipContent[data-state='delayed-open'][data-side='left'] {
- animation-name: slideRightAndFade;
+ animation-name: screenity-slideRightAndFade;
}
-@keyframes slideUpAndFade {
- from {
- opacity: 0;
- transform: translateY(2px);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
+@keyframes screenity-slideUpAndFade {
+ from { opacity: 0; transform: translateY(2px); }
+ to { opacity: 1; transform: translateY(0); }
}
-
-@keyframes slideRightAndFade {
- from {
- opacity: 0;
- transform: translateX(-2px);
- }
- to {
- opacity: 1;
- transform: translateX(0);
- }
+@keyframes screenity-slideRightAndFade {
+ from { opacity: 0; transform: translateX(-2px); }
+ to { opacity: 1; transform: translateX(0); }
}
-
-@keyframes slideDownAndFade {
- from {
- opacity: 0;
- transform: translateY(-2px);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
+@keyframes screenity-slideDownAndFade {
+ from { opacity: 0; transform: translateY(-2px); }
+ to { opacity: 1; transform: translateY(0); }
}
-
-@keyframes slideLeftAndFade {
- from {
- opacity: 0;
- transform: translateX(2px);
- }
- to {
- opacity: 1;
- transform: translateX(0);
- }
+@keyframes screenity-slideLeftAndFade {
+ from { opacity: 0; transform: translateX(2px); }
+ to { opacity: 1; transform: translateX(0); }
}
-#screenity-ui [data-radix-popper-content-wrapper] { z-index: 999999999999!important; }
+#screenity-ui [data-radix-popper-content-wrapper] { z-index: 999999999999!important; }
.screenity-shadow-dom .CanvasContainer {
position: fixed;
@@ -156,7 +129,6 @@ const Content = () => {
padding-top: 12px;
padding-bottom: 12px;
border-radius: 15px;
- z-index: 99999;
font-family: 'Satoshi-Medium', sans-serif;
color: #29292F;
box-shadow: 0px 10px 38px -10px rgba(22, 23, 24, 0.35),
@@ -166,20 +138,20 @@ const Content = () => {
will-change: transform, opacity;
}
.ScreenityDropdownMenuContent[data-side="top"] {
- animation-name: slideDownAndFade;
+ animation-name: screenity-slideDownAndFade;
}
.ScreenityDropdownMenuContent[data-side="right"] {
- animation-name: slideLeftAndFade;
+ animation-name: screenity-slideLeftAndFade;
}
.ScreenityDropdownMenuContent[data-side="bottom"] {
- animation-name: slideUpAndFade;
+ animation-name: screenity-slideUpAndFade;
}
.ScreenityDropdownMenuContent[data-side="left"] {
- animation-name: slideRightAndFade;
+ animation-name: screenity-slideRightAndFade;
}
.ScreenityItemIndicator {
position: absolute;
- right: 12px;
+ right: 12px;
width: 18px;
height: 18px;
background: #3080F8;
@@ -207,57 +179,11 @@ const Content = () => {
cursor: pointer;
}
.ScreenityDropdownMenuItem[data-disabled] {
- color: #6E7684; !important;
+ color: #6E7684 !important;
cursor: not-allowed;
background-color: #F6F7FB !important;
}
-
-
-@keyframes slideUpAndFade {
- from {
- opacity: 0;
- transform: translateY(2px);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
-}
-
-@keyframes slideRightAndFade {
- from {
- opacity: 0;
- transform: translateX(-2px);
- }
- to {
- opacity: 1;
- transform: translateX(0);
- }
-}
-
-@keyframes slideDownAndFade {
- from {
- opacity: 0;
- transform: translateY(-2px);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
-}
-
-@keyframes slideLeftAndFade {
- from {
- opacity: 0;
- transform: translateX(2px);
- }
- to {
- opacity: 1;
- transform: translateX(0);
- }
-}
-
`}</style>
</div>
);
diff --git a/src/pages/Content/DevHUD.jsx b/src/pages/Content/DevHUD.jsx
new file mode 100644
index 0000000..6058b44
--- /dev/null
+++ b/src/pages/Content/DevHUD.jsx
@@ -0,0 +1,203 @@
+import React, { useState, useEffect } from "react";
+import { createPortal } from "react-dom";
+
+const Z = 2147483647;
+
+const BTN = {
+ padding: "4px 8px",
+ fontSize: "11px",
+ border: "1px solid rgba(255,255,255,0.2)",
+ borderRadius: "4px",
+ background: "rgba(0,0,0,0.6)",
+ color: "#fff",
+ cursor: "pointer",
+ whiteSpace: "nowrap",
+ fontFamily: "monospace",
+ lineHeight: "1.4",
+ boxSizing: "border-box",
+};
+
+const DevHUD = ({ contentStateRef, setContentState }) => {
+ const [collapsed, setCollapsed] = useState(true);
+ const [portalEl, setPortalEl] = useState(null);
+
+ useEffect(() => {
+ const el = document.createElement("div");
+ el.id = "screenity-dev-hud-portal";
+ // Make the container itself invisible/non-interfering but ensure its
+ // children (position:fixed) are not clipped by host-page CSS.
+ el.style.cssText = [
+ "position:fixed !important",
+ "top:0 !important",
+ "left:0 !important",
+ "width:0 !important",
+ "height:0 !important",
+ "overflow:visible !important",
+ "pointer-events:none !important",
+ `z-index:${Z} !important`,
+ "display:block !important",
+ "visibility:visible !important",
+ "opacity:1 !important",
+ ].join(";");
+ document.documentElement.appendChild(el);
+ setPortalEl(el);
+ return () => el.remove();
+ }, []);
+
+ const toast = (msg, ms = 8000) => {
+ contentStateRef.current?.openToast?.(msg, () => {}, ms);
+ };
+
+ const actions = [
+ {
+ label: "Stream error modal",
+ fn: () => {
+ const s = contentStateRef.current;
+ s?.openModal?.(
+ chrome.i18n.getMessage("streamErrorModalTitle"),
+ chrome.i18n.getMessage("streamErrorModalDescription"),
+ chrome.i18n.getMessage("permissionsModalDismiss"),
+ null,
+ () => {},
+ () => {},
+ null,
+ null,
+ null,
+ false,
+ chrome.i18n.getMessage("getHelpButton"),
+ () => {
+ chrome.runtime.sendMessage({
+ type: "report-error",
+ errorCode: "DEBUG_TEST",
+ source: "stream-error",
+ });
+ },
+ );
+ },
+ },
+ {
+ label: "Low storage warning",
+ fn: () => toast(chrome.i18n.getMessage("toastStorageLow")),
+ },
+ {
+ label: "Low storage critical",
+ fn: () => toast(chrome.i18n.getMessage("toastStorageCritical")),
+ },
+ {
+ label: "Stream ended toast",
+ fn: () => toast(chrome.i18n.getMessage("streamEndedWarningToast"), 10000),
+ },
+ {
+ label: "Video track ended",
+ fn: () => toast(chrome.i18n.getMessage("videoTrackEndedToast")),
+ },
+ {
+ label: "Audio track ended",
+ fn: () => toast(chrome.i18n.getMessage("audioTrackEndedToast")),
+ },
+ {
+ label: "Stop-ack timeout",
+ fn: () => toast(chrome.i18n.getMessage("stopAckTimeoutToast")),
+ },
+ {
+ label: "Editor recovery",
+ fn: () => toast(chrome.i18n.getMessage("editorRecoveryToast"), 12000),
+ },
+ {
+ label: "Memory limit modal",
+ fn: () => {
+ const s = contentStateRef.current;
+ s?.openModal?.(
+ chrome.i18n.getMessage("memoryLimitTitle"),
+ chrome.i18n.getMessage("memoryLimitDescription"),
+ chrome.i18n.getMessage("understoodButton"),
+ null,
+ () => {},
+ () => {}
+ );
+ },
+ },
+ {
+ label: "Preparing overlay",
+ fn: () => {
+ setContentState?.((p) => ({
+ ...p,
+ preparingRecording: true,
+ processingProgress: 42,
+ }));
+ },
+ },
+ ];
+
+ if (!portalEl) return null;
+
+ // Shared wrapper style — lives inside the zero-size fixed container,
+ // so it needs its own position:fixed to escape.
+ const wrapBase = {
+ position: "fixed",
+ bottom: 6,
+ right: 6,
+ zIndex: Z,
+ pointerEvents: "auto",
+ fontFamily: "monospace",
+ boxSizing: "border-box",
+ };
+
+ const ui = collapsed ? (
+ <div
+ onClick={() => setCollapsed(false)}
+ style={{
+ ...wrapBase,
+ background: "rgba(0,0,0,0.65)",
+ color: "#0f0",
+ fontSize: "10px",
+ padding: "3px 7px",
+ borderRadius: "4px",
+ cursor: "pointer",
+ }}
+ >
+ DEV
+ </div>
+ ) : (
+ <div
+ style={{
+ ...wrapBase,
+ background: "rgba(20,20,20,0.9)",
+ borderRadius: "6px",
+ padding: "8px",
+ display: "flex",
+ flexDirection: "column",
+ gap: "4px",
+ maxWidth: "170px",
+ maxHeight: "80vh",
+ overflowY: "auto",
+ }}
+ >
+ <div
+ style={{
+ display: "flex",
+ justifyContent: "space-between",
+ alignItems: "center",
+ marginBottom: "2px",
+ }}
+ >
+ <span style={{ color: "#0f0", fontSize: "10px" }}>DEV HUD</span>
+ <span
+ onClick={() => setCollapsed(true)}
+ style={{ color: "#888", fontSize: "12px", cursor: "pointer" }}
+ >
+ x
+ </span>
+ </div>
+ {actions.map((a) => (
+ <button key={a.label} style={BTN} onClick={a.fn}>
+ {a.label}
+ </button>
+ ))}
+ </div>
+ );
+
+ return createPortal(ui, portalEl);
+};
+
+export default DevHUD;
diff --git a/src/pages/Content/Wrapper.jsx b/src/pages/Content/Wrapper.jsx
index 2284988..6d26598 100644
--- a/src/pages/Content/Wrapper.jsx
+++ b/src/pages/Content/Wrapper.jsx
@@ -290,7 +290,6 @@ const Wrapper = () => {
className="root-container"
id="screenity-root-container"
style={{
- // all: "initial",
display: "block",
width: "100%",
height: "100%",
@@ -299,6 +298,22 @@ const Wrapper = () => {
left: "0px",
top: "0px",
zIndex: 9999999999,
+ // Isolation: prevent host-page inherited typography from
+ // leaking through the shadow-DOM boundary.
+ fontFamily: "'Satoshi-Medium', sans-serif",
+ fontSize: "16px",
+ lineHeight: "normal",
+ letterSpacing: "normal",
+ wordSpacing: "normal",
+ textTransform: "none",
+ textIndent: "0",
+ textAlign: "left",
+ color: "#29292F",
+ direction: "ltr",
+ whiteSpace: "normal",
+ fontStyle: "normal",
+ fontVariant: "normal",
+ fontWeight: "normal",
}}
ref={shadowRef}
>
diff --git a/src/pages/Content/context/ContentState.jsx b/src/pages/Content/context/ContentState.jsx
index aaf5d65..733c177 100644
--- a/src/pages/Content/context/ContentState.jsx
+++ b/src/pages/Content/context/ContentState.jsx
@@ -10,6 +10,7 @@ import { updateFromStorage } from "./utils/updateFromStorage";
// Shortcuts
import Shortcuts from "../shortcuts/Shortcuts";
+import DevHUD from "../DevHUD";
// import { initializeContentMessageListener } from "./messaging/messageListener";
import { setupHandlers } from "./messaging/handlers";
@@ -552,6 +553,15 @@ const ContentState = (props) => {
null,
chrome.i18n.getMessage("learnMoreDot"),
helpURL,
+ false, // colorSafe
+ chrome.i18n.getMessage("getHelpButton"),
+ () => {
+ chrome.runtime.sendMessage({
+ type: "report-error",
+ errorCode: "REC_RUN_MEMORY",
+ source: "not-enough-space",
+ });
+ },
);
}
setContentState((prevContentState) => ({
@@ -1588,6 +1598,9 @@ const ContentState = (props) => {
>
{props.children}
<Shortcuts shortcuts={contentState.shortcuts} />
+ {process.env.SCREENITY_DEV_MODE === "true" && (
+ <DevHUD contentStateRef={contentStateRef} setContentState={setContentState} />
+ )}
</contentStateContext.Provider>
);
};
diff --git a/src/pages/Content/context/messaging/handlers.js b/src/pages/Content/context/messaging/handlers.js
index 928b4ca..182399c 100644
--- a/src/pages/Content/context/messaging/handlers.js
+++ b/src/pages/Content/context/messaging/handlers.js
@@ -648,8 +648,11 @@ export const setupHandlers = () => {
}));
});
- registerMessage("stream-error", () => {
+ registerMessage("stream-error", (message) => {
const state = getState();
+ const errorCode = message?.errorCode || null;
+ const errorWhy = message?.why || message?.error || null;
+
state.openModal(
chrome.i18n.getMessage("streamErrorModalTitle"),
chrome.i18n.getMessage("streamErrorModalDescription"),
@@ -661,6 +664,19 @@ export const setupHandlers = () => {
() => {
state.dismissRecording();
},
+ null, // image
+ null, // learnMore
+ null, // learnMoreLink
+ false, // colorSafe
+ chrome.i18n.getMessage("getHelpButton"),
+ () => {
+ chrome.runtime.sendMessage({
+ type: "report-error",
+ errorCode,
+ errorWhy,
+ source: "stream-error",
+ });
+ },
);
});
@@ -671,7 +687,7 @@ export const setupHandlers = () => {
if (state.openToast) {
state.openToast(
message.message ||
- "Screen sharing stopped. Stop recording to save your video.",
+ chrome.i18n.getMessage("streamEndedWarningToast"),
() => {},
10000, // Show for 10 seconds
);
@@ -775,10 +791,10 @@ export const setupHandlers = () => {
};
state.openModal(
- "Fast recorder failed",
- "The fast recorder output couldn't be validated on this device.\nYou can download the file anyway.",
- "Download anyway",
- "Cancel",
+ chrome.i18n.getMessage("fastRecorderFailedTitle"),
+ chrome.i18n.getMessage("fastRecorderFailedDescription"),
+ chrome.i18n.getMessage("downloadAnywayButton"),
+ chrome.i18n.getMessage("cancelButton"),
() => {
chrome.runtime.sendMessage({ type: "open-download-mp4" });
},
diff --git a/src/pages/Content/countdown/styles/_Countdown.scss b/src/pages/Content/countdown/styles/_Countdown.scss
index d7936c5..b67027b 100644
--- a/src/pages/Content/countdown/styles/_Countdown.scss
+++ b/src/pages/Content/countdown/styles/_Countdown.scss
@@ -47,6 +47,10 @@
font-weight: 300 !important;
font-family: $font-light !important;
font-size: 48px !important;
+ line-height: 60px !important;
+ letter-spacing: normal !important;
+ text-transform: none !important;
+ word-spacing: normal !important;
color: $color-text-contrast;
text-align: center;
display: block;
@@ -150,6 +154,10 @@
display: block;
padding: 10px 20px;
font-family: $font-medium;
+ font-size: $font-size-normal;
+ line-height: 1.4;
+ letter-spacing: normal;
+ text-transform: none;
color: $color-text-contrast;
z-index: $z-index-max;
width: fit-content;
diff --git a/src/pages/Content/modal/styles/_Modal.scss b/src/pages/Content/modal/styles/_Modal.scss
index d285455..4c4e478 100644
--- a/src/pages/Content/modal/styles/_Modal.scss
+++ b/src/pages/Content/modal/styles/_Modal.scss
@@ -38,6 +38,7 @@ button {
margin: 0;
color: $color-text-primary;
font-size: $font-size-normal;
+ line-height: 1.4;
font-family: $font-bold;
font-weight: 700;
}
diff --git a/src/pages/Content/popup/PopupContainer.jsx b/src/pages/Content/popup/PopupContainer.jsx
index 6f71aaf..78c2602 100644
--- a/src/pages/Content/popup/PopupContainer.jsx
+++ b/src/pages/Content/popup/PopupContainer.jsx
@@ -608,7 +608,10 @@ const PopupContainer = (props) => {
chrome.runtime.sendMessage({ type: "handle-login" });
}}
onDowngradeClick={() => {
- chrome.storage.local.set({ wasLoggedIn: false });
+ chrome.storage.local.set({
+ wasLoggedIn: false,
+ stayLoggedOut: true,
+ });
setContentState((prev) => ({
...prev,
isLoggedIn: false,
diff --git a/src/pages/Content/popup/onboarding/storage.js b/src/pages/Content/popup/onboarding/storage.js
index 8f8c481..5601da0 100644
--- a/src/pages/Content/popup/onboarding/storage.js
+++ b/src/pages/Content/popup/onboarding/storage.js
@@ -2,7 +2,7 @@ const ONBOARDING_SEEN_KEY = "onboardingSeen";
export const hasSeenOnboarding = async (key) => {
try {
- const result = await chrome.storage.local.get([ONBOARDING_SEEN_KEY]);
+ const result = await chrome.storage.sync.get([ONBOARDING_SEEN_KEY]);
const seen = result?.[ONBOARDING_SEEN_KEY];
return Boolean(seen && typeof seen === "object" && seen[key] === true);
} catch {
@@ -12,13 +12,13 @@ export const hasSeenOnboarding = async (key) => {
export const markOnboardingSeen = async (key) => {
try {
- const result = await chrome.storage.local.get([ONBOARDING_SEEN_KEY]);
+ const result = await chrome.storage.sync.get([ONBOARDING_SEEN_KEY]);
const current =
result?.[ONBOARDING_SEEN_KEY] &&
typeof result[ONBOARDING_SEEN_KEY] === "object"
? result[ONBOARDING_SEEN_KEY]
: {};
- await chrome.storage.local.set({
+ await chrome.storage.sync.set({
[ONBOARDING_SEEN_KEY]: {
...current,
[key]: true,
@@ -29,7 +29,7 @@ export const markOnboardingSeen = async (key) => {
export const resetOnboardingSeen = async (keys = []) => {
try {
- const result = await chrome.storage.local.get([ONBOARDING_SEEN_KEY]);
+ const result = await chrome.storage.sync.get([ONBOARDING_SEEN_KEY]);
const current =
result?.[ONBOARDING_SEEN_KEY] &&
typeof result[ONBOARDING_SEEN_KEY] === "object"
@@ -46,7 +46,7 @@ export const resetOnboardingSeen = async (keys = []) => {
});
}
- await chrome.storage.local.set({
+ await chrome.storage.sync.set({
[ONBOARDING_SEEN_KEY]: current,
});
} catch {}
diff --git a/src/pages/Content/region/Region.jsx b/src/pages/Content/region/Region.jsx
index a247584..dfb3e90 100644
--- a/src/pages/Content/region/Region.jsx
+++ b/src/pages/Content/region/Region.jsx
@@ -1,4 +1,4 @@
-import React, { useState, useRef, useContext, useEffect } from "react";
+import React, { useRef, useContext, useEffect } from "react";
import { Rnd } from "react-rnd";
// Context
@@ -139,6 +139,41 @@ const ResizableBox = () => {
};
}, []);
+ // Shadow DOM event forwarding: mouse events from inside the Shadow DOM
+ // get retargeted to the shadow host and stop at `document` — they never
+ // reach `window`. re-resizable listens on `window`, so we forward the
+ // events that originate from our shadow container.
+ useEffect(() => {
+ const shadowHostId = "screenity-root-container";
+
+ const forwardToWindow = (e) => {
+ if (
+ e.target?.id === shadowHostId ||
+ e.target?.closest?.("#" + shadowHostId)
+ ) {
+ window.dispatchEvent(
+ new MouseEvent(e.type, {
+ bubbles: false,
+ cancelable: true,
+ clientX: e.clientX,
+ clientY: e.clientY,
+ screenX: e.screenX,
+ screenY: e.screenY,
+ button: e.button,
+ buttons: e.buttons,
+ })
+ );
+ }
+ };
+
+ document.addEventListener("mouseup", forwardToWindow);
+ document.addEventListener("mousemove", forwardToWindow);
+ return () => {
+ document.removeEventListener("mouseup", forwardToWindow);
+ document.removeEventListener("mousemove", forwardToWindow);
+ };
+ }, []);
+
return (
<div
style={{
@@ -209,6 +244,7 @@ const ResizableBox = () => {
}}
minWidth={50}
minHeight={50}
+ cancel=".resize-handle-wrapper"
resizeHandleWrapperClass="resize-handle-wrapper"
resizeHandleComponent={{
topLeft: <div className="resize-handle top-left" />,
diff --git a/src/pages/Content/styles/app.css b/src/pages/Content/styles/app.css
index f908cb6..08da88b 100644
--- a/src/pages/Content/styles/app.css
+++ b/src/pages/Content/styles/app.css
@@ -278,6 +278,7 @@ iframe {
width: 42px;
color: #29292f;
font-size: 13px;
+ line-height: 1;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
@@ -3848,6 +3849,10 @@ button {
font-weight: 300 !important;
font-family: "Satoshi-Light", sans-serif !important;
font-size: 48px !important;
+ line-height: 60px !important;
+ letter-spacing: normal !important;
+ text-transform: none !important;
+ word-spacing: normal !important;
color: #fff;
text-align: center;
display: block;
@@ -3947,6 +3952,10 @@ button {
display: block;
padding: 10px 20px;
font-family: "Satoshi-Medium", sans-serif;
+ font-size: 14px;
+ line-height: 1.4;
+ letter-spacing: normal;
+ text-transform: none;
color: #fff;
z-index: 99999999999;
width: -moz-fit-content;
@@ -3991,6 +4000,7 @@ button {
margin: 0;
color: #29292f;
font-size: 14px;
+ line-height: 1.4;
font-family: "Satoshi-Bold", sans-serif;
font-weight: 700;
}
@@ -4280,12 +4290,14 @@ button {
.warning-title {
color: #fff;
font-family: "Satoshi-Medium", sans-serif;
+ line-height: 1.4;
}
.warning-description {
color: #fff;
opacity: 0.8;
font-family: "Satoshi-Medium", sans-serif;
+ line-height: 1.5;
}
.ToastAction {
@@ -4306,8 +4318,17 @@ button {
cursor: pointer;
}
-html {
+:host {
font-size: 16px;
+ line-height: normal;
+ letter-spacing: normal;
+ word-spacing: normal;
+ text-transform: none;
+ font-style: normal;
+ font-variant: normal;
+ text-indent: 0;
+ direction: ltr;
+ white-space: normal;
}
.screenity-scrollbar::-webkit-scrollbar {
diff --git a/src/pages/Content/styles/app.scss b/src/pages/Content/styles/app.scss
index b73d57e..3276095 100644
--- a/src/pages/Content/styles/app.scss
+++ b/src/pages/Content/styles/app.scss
@@ -10,8 +10,18 @@
@use "./_variables" as *;
@use "sass:color";
-html {
+// Reset inherited properties inside the shadow tree.
+:host {
font-size: 16px;
+ line-height: normal;
+ letter-spacing: normal;
+ word-spacing: normal;
+ text-transform: none;
+ font-style: normal;
+ font-variant: normal;
+ text-indent: 0;
+ direction: ltr;
+ white-space: normal;
}
.screenity-scrollbar::-webkit-scrollbar {
diff --git a/src/pages/Content/toolbar/styles/layout/_Toolbar.scss b/src/pages/Content/toolbar/styles/layout/_Toolbar.scss
index 63f0110..99e6ccf 100644
--- a/src/pages/Content/toolbar/styles/layout/_Toolbar.scss
+++ b/src/pages/Content/toolbar/styles/layout/_Toolbar.scss
@@ -245,6 +245,7 @@ iframe {
width: 42px;
color: $color-text-primary;
font-size: 13px;
+ line-height: 1;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
diff --git a/src/pages/Content/warning/styles/_Warning.scss b/src/pages/Content/warning/styles/_Warning.scss
index ba3454a..f967d94 100644
--- a/src/pages/Content/warning/styles/_Warning.scss
+++ b/src/pages/Content/warning/styles/_Warning.scss
@@ -93,12 +93,14 @@
.warning-title {
color: $color-text-contrast;
font-family: $font-medium;
+ line-height: 1.4;
}
.warning-description {
color: $color-text-contrast;
opacity: 0.8;
font-family: $font-medium;
+ line-height: 1.5;
}
.ToastAction {
diff --git a/src/pages/EditorWebCodecs/Sandbox.jsx b/src/pages/EditorWebCodecs/Sandbox.jsx
index ed6fbf7..6097511 100644
--- a/src/pages/EditorWebCodecs/Sandbox.jsx
+++ b/src/pages/EditorWebCodecs/Sandbox.jsx
@@ -38,7 +38,7 @@ const Sandbox = () => {
function isMp4Blob(blob) {
return blob
- .slice(4, 12)
+ .slice(4, 8)
.text()
.then((t) => t === "ftyp");
}
@@ -89,6 +89,7 @@ const Sandbox = () => {
base64,
topLevel: true,
fromAudio: true,
+ _opId: message._opId,
});
break;
}
@@ -111,6 +112,7 @@ const Sandbox = () => {
type: "updated-blob",
base64,
topLevel: true,
+ _opId: message._opId,
});
break;
}
@@ -118,7 +120,7 @@ const Sandbox = () => {
case "base64-to-blob": {
const rawBlob = await fetch(message.base64).then((r) => r.blob());
- const header = await rawBlob.slice(4, 12).text();
+ const header = await rawBlob.slice(4, 8).text();
const looksMp4 = header === "ftyp";
if (looksMp4) {
@@ -165,7 +167,7 @@ const Sandbox = () => {
(progress) => sendMessage({ type: "ffmpeg-progress", progress })
);
const base64 = await toBase64(blob);
- sendMessage({ type: "updated-blob", base64, topLevel: true });
+ sendMessage({ type: "updated-blob", base64, topLevel: true, _opId: message._opId });
break;
}
@@ -186,6 +188,7 @@ const Sandbox = () => {
base64,
addToHistory: true,
topLevel: true,
+ _opId: message._opId,
});
break;
}
@@ -221,6 +224,7 @@ const Sandbox = () => {
base64,
addToHistory: true,
topLevel: true,
+ _opId: message._opId,
});
break;
}
@@ -237,7 +241,7 @@ const Sandbox = () => {
})
);
const base64 = await toBase64(blob);
- sendMessage({ type: "updated-blob", base64, topLevel: true });
+ sendMessage({ type: "updated-blob", base64, topLevel: true, _opId: message._opId });
break;
}
@@ -271,7 +275,12 @@ const Sandbox = () => {
break;
}
} catch (error) {
- sendMessage({ type: "ffmpeg-error", error: JSON.stringify(error) });
+ const errMsg = error instanceof Error ? error.message : String(error);
+ if (errMsg.includes("too long")) {
+ sendMessage({ type: "edit-too-long", _opId: message._opId });
+ } else {
+ sendMessage({ type: "ffmpeg-error", error: JSON.stringify(error), _opId: message._opId });
+ }
}
};
diff --git a/src/pages/EditorWebCodecs/mediabunny/lib/videoAudioMixer.ts b/src/pages/EditorWebCodecs/mediabunny/lib/videoAudioMixer.ts
index ac59d10..51b145c 100644
--- a/src/pages/EditorWebCodecs/mediabunny/lib/videoAudioMixer.ts
+++ b/src/pages/EditorWebCodecs/mediabunny/lib/videoAudioMixer.ts
@@ -12,6 +12,7 @@ import {
ALL_FORMATS,
QUALITY_HIGH,
} from "mediabunny";
+import { videoConverter } from "./videoConverter";
export class VideoAudioMixer {
async addAudio(
@@ -39,14 +40,25 @@ export class VideoAudioMixer {
const videoTrack = await input.getPrimaryVideoTrack();
const videoSink = new VideoSampleSink(videoTrack);
+ const codecInfo = await videoConverter.detectBestCodec("mp4");
+ const videoCodec = codecInfo?.codec ?? "avc";
const videoSource = new VideoSampleSource({
- codec: "avc",
+ codec: videoCodec,
bitrate: QUALITY_HIGH,
});
output.addVideoTrack(videoSource);
const videoDuration = await this._getDuration(videoBlob);
+ // Mixing decodes the full audio track + allocates a mixBuffer — cap at
+ // 15 min to avoid OOM in the renderer process.
+ if (videoDuration > 900) {
+ throw new Error(
+ `Video is too long for in-browser audio mixing (${Math.round(videoDuration / 60)} min). ` +
+ `Maximum supported length is 15 minutes.`
+ );
+ }
+
const hasVideoAudio = await input
.getPrimaryAudioTrack()
.then((t) => !!t)
@@ -58,9 +70,15 @@ export class VideoAudioMixer {
});
output.addAudioTrack(audioSource);
- const bgArrayBuffer = await audioBlob.arrayBuffer();
+ let bgArrayBuffer = await audioBlob.arrayBuffer();
const audioCtx = new AudioContext();
- const decodedAudio = await audioCtx.decodeAudioData(bgArrayBuffer);
+ let decodedAudio;
+ try {
+ decodedAudio = await audioCtx.decodeAudioData(bgArrayBuffer);
+ bgArrayBuffer = null; // release compressed audio bytes; PCM is now in decodedAudio
+ } finally {
+ audioCtx.close().catch(() => {});
+ }
const sr = decodedAudio.sampleRate;
const audioDur = decodedAudio.duration;
@@ -81,15 +99,18 @@ export class VideoAudioMixer {
};
if (hasVideoAudio && mode === "mix") {
+ const videoAudioCtx = new AudioContext();
try {
const videoArrayBuffer = await videoBlob.arrayBuffer();
- const videoAudioCtx = new AudioContext();
const decodedVideoAudio = await videoAudioCtx.decodeAudioData(
videoArrayBuffer
);
const videoSamples = decodedVideoAudio.getChannelData(0);
writeMix(videoSamples, 0, videoVolume);
- } catch {}
+ } catch {
+ } finally {
+ videoAudioCtx.close().catch(() => {});
+ }
}
const loopCount = loop
diff --git a/src/pages/EditorWebCodecs/mediabunny/lib/videoCutter.ts b/src/pages/EditorWebCodecs/mediabunny/lib/videoCutter.ts
index 1d0b6c1..c34288b 100644
--- a/src/pages/EditorWebCodecs/mediabunny/lib/videoCutter.ts
+++ b/src/pages/EditorWebCodecs/mediabunny/lib/videoCutter.ts
@@ -12,6 +12,7 @@ import {
VideoSampleSink,
AudioSampleSink,
} from "mediabunny";
+import { videoConverter } from "./videoConverter";
export class VideoCutter {
async cut(sourceBlob, { cutStart, cutEnd, onProgress }) {
@@ -31,8 +32,10 @@ export class VideoCutter {
const videoTrack = await input.getPrimaryVideoTrack();
const audioTrack = await input.getPrimaryAudioTrack().catch(() => null);
+ const codecInfo = await videoConverter.detectBestCodec("mp4");
+ const videoCodec = codecInfo?.codec ?? "avc";
const videoSource = new VideoSampleSource({
- codec: "avc",
+ codec: videoCodec,
bitrate: QUALITY_HIGH,
sizeChangeBehavior: "passThrough",
});
diff --git a/src/pages/EditorWebCodecs/mediabunny/lib/videoMuter.ts b/src/pages/EditorWebCodecs/mediabunny/lib/videoMuter.ts
index cbc102f..3879714 100644
--- a/src/pages/EditorWebCodecs/mediabunny/lib/videoMuter.ts
+++ b/src/pages/EditorWebCodecs/mediabunny/lib/videoMuter.ts
@@ -12,6 +12,7 @@ import {
ALL_FORMATS,
QUALITY_HIGH,
} from "mediabunny";
+import { videoConverter } from "./videoConverter";
export class VideoMuter {
async mute(
@@ -25,6 +26,15 @@ export class VideoMuter {
} = {}
) {
const videoDuration = await this._getDuration(videoBlob);
+
+ // Cap at 15 min to avoid OOM — re-encoding needs several copies in memory.
+ if (videoDuration > 900) {
+ throw new Error(
+ `Video is too long for in-browser audio muting (${Math.round(videoDuration / 60)} min). ` +
+ `Maximum supported length is 15 minutes.`
+ );
+ }
+
const input = new Input({
source: new BlobSource(videoBlob),
formats: ALL_FORMATS,
@@ -38,18 +48,25 @@ export class VideoMuter {
const videoTrack = await input.getPrimaryVideoTrack();
const videoSink = new VideoSampleSink(videoTrack);
+ const codecInfo = await videoConverter.detectBestCodec("mp4");
+ const videoCodec = codecInfo?.codec ?? "avc";
const videoSource = new VideoSampleSource({
- codec: "avc",
+ codec: videoCodec,
bitrate: QUALITY_HIGH,
});
output.addVideoTrack(videoSource);
let decodedAudio = null;
+ const ctx = new AudioContext();
try {
- const buf = await videoBlob.arrayBuffer();
- const ctx = new AudioContext();
+ let buf = await videoBlob.arrayBuffer();
decodedAudio = await ctx.decodeAudioData(buf);
- } catch {}
+ buf = null; // release compressed bytes; PCM is now in decodedAudio
+ } catch {
+ // decode failed; mute returns original blob below
+ } finally {
+ ctx.close().catch(() => {});
+ }
const sr = decodedAudio?.sampleRate || 48000;
const mixBuffer = new Float32Array(Math.ceil(sr * videoDuration));
@@ -101,9 +118,8 @@ export class VideoMuter {
}
await output.finalize();
- return new Blob([outputTarget.buffer], {
- type: outputFormat === "webm" ? "video/webm" : "video/mp4",
- });
+ // Always MP4 container — use correct MIME type.
+ return new Blob([outputTarget.buffer], { type: "video/mp4" });
}
async _getDuration(blob) {
diff --git a/src/pages/Recorder/Recorder.jsx b/src/pages/Recorder/Recorder.jsx
index 3f67197..2029421 100644
--- a/src/pages/Recorder/Recorder.jsx
+++ b/src/pages/Recorder/Recorder.jsx
@@ -1,4 +1,4 @@
-import React, { useEffect, useState, useRef, useCallback } from "react";
+import React, { useEffect, useState, useRef } from "react";
import localforage from "localforage";
import RecorderUI from "./RecorderUI";
import { createMediaRecorder } from "./mediaRecorderUtils";
@@ -60,6 +60,25 @@ function debugError(...args) {
console.error(logPrefix, ...args);
}
+// Stream lifecycle ring-buffer — persisted to storage, survives tab discards.
+const SL_KEY = "streamLifecycleLog";
+const SL_MAX = 40; // keep last N entries
+const _slBuffer = [];
+
+function slLog(tag, extra = {}) {
+ const entry = { t: Date.now(), tag, ...extra };
+ if (DEBUG_RECORDER) {
+ // eslint-disable-next-line no-console
+ console.log("[Screenity:SL]", tag, entry);
+ }
+ _slBuffer.push(entry);
+ if (_slBuffer.length > SL_MAX) _slBuffer.splice(0, _slBuffer.length - SL_MAX);
+ // Fire-and-forget persist.
+ try {
+ chrome.storage.local.set({ [SL_KEY]: [..._slBuffer] });
+ } catch { /* storage unavailable — tab possibly being torn down */ }
+}
+
function logCaptureContext(label, stream) {
if (!DEBUG_RECORDER && !isRecordingDebugEnabled()) return;
const videoTracks =
@@ -194,6 +213,14 @@ const Recorder = () => {
const index = useRef(0);
const [started, setStarted] = useState(false);
+ const streamReadyAt = useRef(null);
+
+ // Start gate: defers startRecording() until the stream is ready.
+ const startRequested = useRef(false);
+ const startRequestedAt = useRef(null);
+ // Timeout if the stream never arrives
+ const startGateTimeout = useRef(null);
+ const START_GATE_TIMEOUT_MS = 8000; // max wait for stream after start request
const liveStream = useRef(null);
@@ -224,12 +251,15 @@ const Recorder = () => {
const lastEstimateAt = useRef(0);
const ESTIMATE_INTERVAL_MS = 5000;
const MIN_HEADROOM = 25 * 1024 * 1024;
+ const WARN_HEADROOM = 100 * 1024 * 1024; // early warning before hard abort
const MAX_PENDING_BYTES = 8 * 1024 * 1024;
const pendingBytes = useRef(0);
+ const lowStorageWarned = useRef(false);
const uiClosing = useRef(false);
const isRecording = useRef(false);
+ const isStarting = useRef(false);
const pausedStateRef = useRef(false);
const stopSignalSent = useRef(false);
@@ -242,6 +272,7 @@ const Recorder = () => {
const recordingTick = useRef(null);
debug("Recorder component mounted");
+ slLog("component-mount");
const setRecordingTimingState = async (nextState) => {
try {
@@ -271,6 +302,15 @@ const Recorder = () => {
ok,
});
}
+ // Early warning before hard abort
+ if (!lowStorageWarned.current && remaining < WARN_HEADROOM) {
+ lowStorageWarned.current = true;
+ chrome.runtime.sendMessage({
+ type: "show-toast",
+ message: chrome.i18n.getMessage("toastStorageLow"),
+ timeout: 8000,
+ }).catch(() => {});
+ }
return ok;
} catch (err) {
debugWarn("navigator.storage.estimate() failed, assuming OK", err);
@@ -402,7 +442,7 @@ const Recorder = () => {
};
// Emit stop to background at most once per recording session.
- const requestStop = (reason = "generic") => {
+ const requestStop = (reason = "generic", extra = {}) => {
if (stopSignalSent.current) {
debugWarn("requestStop() ignored; already sent", { reason });
return false;
@@ -416,7 +456,7 @@ const Recorder = () => {
return false;
}
stopSignalSent.current = true;
- sendStopRecording(reason);
+ sendStopRecording(reason, extra);
return true;
};
@@ -425,14 +465,23 @@ const Recorder = () => {
if (!(await canFitChunk(e.data.size))) {
debugWarn("Low storage, aborting recording");
+ if (!lowStorageAbort.current) {
+ chrome.runtime.sendMessage({
+ type: "show-toast",
+ message: chrome.i18n.getMessage("toastStorageCritical"),
+ timeout: 8000,
+ });
+ }
lowStorageAbort.current = true;
chrome.storage.local.set({
recording: false,
restarting: false,
tabRecordedID: null,
memoryError: true,
+ lowStorageAbortAt: Date.now(),
+ lowStorageAbortChunks: index.current,
});
- requestStop("low-storage");
+ requestStop("low-storage", { memoryError: true, savedChunks: savedCount.current });
return false;
}
@@ -451,14 +500,23 @@ const Recorder = () => {
}
} catch (err) {
debugError("Failed to save chunk, aborting recording", err);
+ if (!lowStorageAbort.current) {
+ chrome.runtime.sendMessage({
+ type: "show-toast",
+ message: chrome.i18n.getMessage("toastStorageCritical"),
+ timeout: 8000,
+ });
+ }
lowStorageAbort.current = true;
chrome.storage.local.set({
recording: false,
restarting: false,
tabRecordedID: null,
memoryError: true,
+ lowStorageAbortAt: Date.now(),
+ lowStorageAbortChunks: index.current,
});
- requestStop("chunk-save-failed");
+ requestStop("chunk-save-failed", { memoryError: true, savedChunks: savedCount.current });
return false;
}
@@ -496,14 +554,23 @@ const Recorder = () => {
if (!(await canFitChunk(e.data.size))) {
debugWarn("Low storage during drain, stopping recording");
+ if (!lowStorageAbort.current) {
+ chrome.runtime.sendMessage({
+ type: "show-toast",
+ message: chrome.i18n.getMessage("toastStorageCritical"),
+ timeout: 8000,
+ });
+ }
lowStorageAbort.current = true;
chrome.storage.local.set({
recording: false,
restarting: false,
tabRecordedID: null,
memoryError: true,
+ lowStorageAbortAt: Date.now(),
+ lowStorageAbortChunks: index.current,
});
- requestStop("low-storage");
+ requestStop("low-storage", { memoryError: true, savedChunks: savedCount.current });
pending.current.length = 0;
pendingBytes.current = 0;
break;
@@ -543,12 +610,152 @@ const Recorder = () => {
});
}, []);
+ // Check whether the stream is in a startable state.
+ function getStreamReadiness() {
+ if (!helperVideoStream.current) return { ready: false, reason: "stream-ref-null" };
+ const vt = helperVideoStream.current.getVideoTracks();
+ if (vt.length === 0) return { ready: false, reason: "zero-video-tracks" };
+ if (vt[0].readyState !== "live") return { ready: false, reason: "track-not-live", trackState: vt[0].readyState };
+ return { ready: true };
+ }
+
+ function buildStreamDiagInfo(bucket) {
+ const stream = helperVideoStream.current;
+ const vt = stream?.getVideoTracks?.() ?? [];
+ return {
+ bucket,
+ started,
+ streamReadyAt: streamReadyAt.current,
+ msSinceReady: streamReadyAt.current ? Date.now() - streamReadyAt.current : null,
+ msSinceStartRequested: startRequestedAt.current ? Date.now() - startRequestedAt.current : null,
+ streamExists: !!stream,
+ streamActive: stream?.active ?? null,
+ streamId: stream?.id ?? null,
+ videoTrackCount: vt.length,
+ audioTrackCount: stream?.getAudioTracks?.()?.length ?? null,
+ trackReadyState: vt[0]?.readyState ?? null,
+ trackEnabled: vt[0]?.enabled ?? null,
+ trackMuted: vt[0]?.muted ?? null,
+ docHidden: document.hidden,
+ docVisibility: document.visibilityState,
+ };
+ }
+
+ /** Arm a timeout that errors if the stream never shows up. */
+ function armStartGateTimeout() {
+ clearStartGateTimeout();
+ startGateTimeout.current = setTimeout(() => {
+ if (!startRequested.current) return; // request was fulfilled or cancelled
+ const readiness = getStreamReadiness();
+ if (readiness.ready) {
+ // Race: stream arrived just before timeout
+ slLog("start-gate-timeout-race-ok");
+ tryStartIfReady();
+ return;
+ }
+ const diagInfo = buildStreamDiagInfo("start-gate-timeout");
+ console.warn("[Screenity:startRec] stream never became ready", diagInfo);
+ slLog("start-gate-timeout", diagInfo);
+ chrome.storage.local.set({ lastStreamCheckFail: diagInfo });
+ // Full reset so no gate state leaks into a future session.
+ resetGateState();
+ sendRecordingError(
+ "Recording not ready: screen stream is missing (tab may have been suspended)",
+ );
+ }, START_GATE_TIMEOUT_MS);
+ }
+
+ function clearStartGateTimeout() {
+ if (startGateTimeout.current) {
+ clearTimeout(startGateTimeout.current);
+ startGateTimeout.current = null;
+ }
+ }
+
+ /** Reset gate state on stop/dismiss/restart. */
+ function resetGateState() {
+ startRequested.current = false;
+ startRequestedAt.current = null;
+ isStarting.current = false;
+ clearStartGateTimeout();
+ }
+
+ /** Request recording start — immediate if stream is ready, deferred otherwise. */
+ function requestStart() {
+ if (recorder.current !== null || isStarting.current) {
+ debugWarn("requestStart() called but recorder already exists or start in flight");
+ slLog("requestStart-bail-already-active", {
+ hasRecorder: recorder.current !== null,
+ isStarting: isStarting.current,
+ });
+ return;
+ }
+ if (isRestarting.current) {
+ pendingStartAfterRestart.current = true;
+ slLog("requestStart-queued-restart");
+ debug("Queued start request while restarting");
+ return;
+ }
+ if (startRequested.current) {
+ // Already waiting — ignore duplicate.
+ slLog("requestStart-bail-already-requested");
+ return;
+ }
+
+ startRequested.current = true;
+ startRequestedAt.current = Date.now();
+ slLog("requestStart", {
+ hasStream: !!helperVideoStream.current,
+ started,
+ docHidden: document.hidden,
+ docVisibility: document.visibilityState,
+ });
+
+ const readiness = getStreamReadiness();
+ if (readiness.ready) {
+ slLog("requestStart-immediate", readiness);
+ startRecording();
+ } else {
+ slLog("requestStart-deferred", readiness);
+ armStartGateTimeout();
+ }
+ }
+
+ /** If a start was requested and the stream is ready, fire startRecording(). */
+ function tryStartIfReady() {
+ if (!startRequested.current) return;
+ const readiness = getStreamReadiness();
+ slLog("tryStartIfReady", readiness);
+ if (readiness.ready) {
+ clearStartGateTimeout();
+ startRecording();
+ }
+ // Otherwise the gate timeout handles it.
+ }
+
+ // startRecording — stream must be ready (verified by the gate above).
async function startRecording() {
- if (recorder.current !== null) {
- debugWarn("startRecording() called but recorder already exists");
+ slLog("startRecording-enter", {
+ hasRecorder: recorder.current !== null,
+ hasStream: !!helperVideoStream.current,
+ started,
+ streamReadyAt: streamReadyAt.current,
+ docHidden: document.hidden,
+ });
+
+ // Acting on the request now — reset gate state.
+ resetGateState();
+
+ if (recorder.current !== null || isStarting.current) {
+ debugWarn("startRecording() called but recorder already exists or start in flight");
+ slLog("startRecording-bail-already-active", {
+ hasRecorder: recorder.current !== null,
+ isStarting: isStarting.current,
+ });
return;
}
+ isStarting.current = true;
debug("startRecording()");
recordingGeneration.current += 1;
const runGeneration = recordingGeneration.current;
@@ -559,16 +766,55 @@ const Recorder = () => {
// Record the start time for session tracking
recordingStartTime.current = Date.now();
+ // Final preflight — edge-case guard in case state changed since the gate.
navigator.storage.persist();
- if (
- !helperVideoStream.current ||
- helperVideoStream.current.getVideoTracks().length === 0
- ) {
- debugError("No video tracks available in helperVideoStream");
+ if (!helperVideoStream.current) {
+ const diagInfo = buildStreamDiagInfo("stream-ref-null");
+ console.warn("[Screenity:startRec] helperVideoStream is null", diagInfo);
+ slLog("startRecording-fail-stream-null", diagInfo);
+ chrome.storage.local.set({ lastStreamCheckFail: diagInfo });
+ sendRecordingError(
+ "Recording not ready: screen stream is missing (tab may have been suspended)",
+ );
+ stopTabKeepAlive();
+ isStarting.current = false;
+ return;
+ }
+ const videoTracks = helperVideoStream.current.getVideoTracks();
+ if (videoTracks.length === 0) {
+ const diagInfo = buildStreamDiagInfo("stream-zero-video-tracks");
+ console.warn("[Screenity:startRec] helperVideoStream has 0 video tracks", diagInfo);
+ slLog("startRecording-fail-zero-tracks", diagInfo);
+ chrome.storage.local.set({ lastStreamCheckFail: diagInfo });
sendRecordingError("No video tracks available");
stopTabKeepAlive();
+ isStarting.current = false;
return;
}
+ {
+ const vt = videoTracks[0];
+ const diagInfo = {
+ bucket: "stream-ok",
+ trackReadyState: vt.readyState,
+ trackEnabled: vt.enabled,
+ trackMuted: vt.muted,
+ msSinceReady: streamReadyAt.current
+ ? Date.now() - streamReadyAt.current
+ : null,
+ };
+ slLog("startRecording-preflight-ok", diagInfo);
+ if (vt.readyState === "ended") {
+ console.warn("[Screenity:startRec] video track present but ended", diagInfo);
+ slLog("startRecording-fail-track-ended", diagInfo);
+ chrome.storage.local.set({ lastStreamCheckFail: diagInfo });
+ sendRecordingError(
+ "Recording not ready: screen stream ended (tab may have been suspended)",
+ );
+ stopTabKeepAlive();
+ isStarting.current = false;
+ return;
+ }
+ }
await chunksStore.clear();
debug("Cleared chunksStore");
@@ -701,25 +947,13 @@ const Recorder = () => {
fps,
});
- await setRecordingTimingState({
- recording: true,
- paused: false,
- recordingStartTime: recordingStartTime.current,
- pausedAt: null,
- totalPausedMs: 0,
- });
+ // Reset pre-recording state. Recording-committed state (isRecording,
+ // heartbeat, timing) is set after the recorder is created successfully.
pausedStateRef.current = false;
chrome.storage.local.set({ restarting: false });
-
- isRecording.current = true;
isRestarting.current = false;
index.current = 0;
- // Start session heartbeat for recovery tracking
- startSessionHeartbeat();
- startRecordingTick();
- persistSessionState("recording");
-
const handleChunk = async (data, timestampMs) => {
if (runGeneration !== recordingGeneration.current) {
return;
@@ -818,6 +1052,17 @@ const Recorder = () => {
void drainQueue();
};
+ // Abort if stop/dismiss was requested during async setup.
+ if (isFinishing.current || uiClosing.current) {
+ slLog("startRecording-abort-interrupted", {
+ isFinishing: isFinishing.current,
+ uiClosing: uiClosing.current,
+ });
+ isStarting.current = false;
+ stopTabKeepAlive();
+ return;
+ }
+
try {
if (canUseWebCodecs) {
useWebCodecs.current = true;
@@ -1028,6 +1273,8 @@ const Recorder = () => {
sendRecordingError(
"Failed to start recording: " + String(initErr),
);
+ isStarting.current = false;
+ stopTabKeepAlive();
return;
}
}
@@ -1037,6 +1284,9 @@ const Recorder = () => {
} catch (err) {
debugError("Failed to start MediaRecorder", err);
sendRecordingError("Failed to start recording: " + String(err));
+ recorder.current = null;
+ isStarting.current = false;
+ stopTabKeepAlive();
return;
}
@@ -1107,9 +1357,25 @@ const Recorder = () => {
});
}
sendRecordingError(String(err));
+ isStarting.current = false;
+ stopTabKeepAlive();
return;
}
+ // Recorder created successfully — now advertise "recording" to the system.
+ await setRecordingTimingState({
+ recording: true,
+ paused: false,
+ recordingStartTime: recordingStartTime.current,
+ pausedAt: null,
+ totalPausedMs: 0,
+ });
+ isStarting.current = false;
+ isRecording.current = true;
+ startSessionHeartbeat();
+ startRecordingTick();
+ persistSessionState("recording");
+
if (helperAudioStream.current) {
const track = helperAudioStream.current.getAudioTracks()[0];
if (track) {
@@ -1130,6 +1396,12 @@ const Recorder = () => {
"[Recorder] Audio track ended unexpectedly",
diagnosticInfo,
);
+ // Notify via stream-ended-warning toast
+ chrome.runtime.sendMessage({
+ type: "recording-error",
+ error: "stream-ended",
+ why: chrome.i18n.getMessage("audioTrackEndedToast"),
+ }).catch(() => {});
chrome.storage.local.set({
recording: false,
lastTrackEndEvent: diagnosticInfo,
@@ -1156,6 +1428,12 @@ const Recorder = () => {
trackReadyState: track?.readyState || null,
};
console.warn("[Recorder] liveStream video track ended", diagnosticInfo);
+ // Notify via stream-ended-warning toast
+ chrome.runtime.sendMessage({
+ type: "recording-error",
+ error: "stream-ended",
+ why: chrome.i18n.getMessage("videoTrackEndedToast"),
+ }).catch(() => {});
chrome.storage.local.set({
recording: false,
restarting: false,
@@ -1187,6 +1465,12 @@ const Recorder = () => {
"[Recorder] helperVideoStream video track ended",
diagnosticInfo,
);
+ // Notify via stream-ended-warning toast
+ chrome.runtime.sendMessage({
+ type: "recording-error",
+ error: "stream-ended",
+ why: chrome.i18n.getMessage("videoTrackEndedToast"),
+ }).catch(() => {});
chrome.storage.local.set({
recording: false,
restarting: false,
@@ -1307,6 +1591,8 @@ const Recorder = () => {
return;
}
debug("stopRecording()");
+ // Stop takes priority over any pending start gate.
+ resetGateState();
isFinishing.current = true;
isRecording.current = false;
await updateFreeFinalizeStatus("stopping", 0);
@@ -1360,6 +1646,7 @@ const Recorder = () => {
if (!isRestarting.current) {
debug("Stopping tracks and clearing streams");
+ slLog("helperVideoStream-nulling", { path: "stopRecording" });
liveStream.current?.getTracks().forEach((t) => t.stop());
helperVideoStream.current?.getTracks().forEach((t) => t.stop());
helperAudioStream.current?.getTracks().forEach((t) => t.stop());
@@ -1375,6 +1662,7 @@ const Recorder = () => {
const dismissRecording = async () => {
debug("dismissRecording()");
+ resetGateState();
uiClosing.current = true;
isRecording.current = false;
@@ -1403,6 +1691,9 @@ const Recorder = () => {
debug("restartRecording()");
recordingGeneration.current += 1;
+ // Kill any stale start-gate timeout from the previous session.
+ resetGateState();
+
isRestarting.current = true;
isRecording.current = false;
sentLast.current = false;
@@ -1477,10 +1768,14 @@ const Recorder = () => {
isRestarting.current = false;
debug("restartRecording() done, ready to start again");
+ slLog("restart-done", {
+ hasStream: !!helperVideoStream.current,
+ hasPendingStart: pendingStartAfterRestart.current,
+ });
if (pendingStartAfterRestart.current) {
pendingStartAfterRestart.current = false;
debug("Processing queued start after restart");
- startRecording();
+ requestStart();
}
return true;
};
@@ -1588,6 +1883,11 @@ const Recorder = () => {
};
async function startStream(data, id, options, permissions, permissions2) {
+ slLog("startStream-enter", {
+ recordingType: data.recordingType,
+ hasId: !!id,
+ isTab: isTab.current,
+ });
debug("startStream()", {
recordingType: data.recordingType,
id,
@@ -1748,15 +2048,18 @@ const Recorder = () => {
if (data.recordingType === "camera") {
if (!userStream || typeof userStream.getVideoTracks !== "function") {
debugWarn("Camera stream unavailable");
+ resetGateState();
sendRecordingError("Camera stream unavailable");
return;
}
if (!userStream.getVideoTracks().length) {
debugWarn("Camera stream has no video track");
+ resetGateState();
sendRecordingError("Camera stream has no video track");
return;
}
helperVideoStream.current = userStream;
+ slLog("helperVideoStream-assigned", { path: "camera", streamId: userStream.id });
} else {
const constraints = {
audio: {
@@ -1779,6 +2082,7 @@ const Recorder = () => {
};
debug("desktopCapture getUserMedia constraints", constraints);
+ slLog("getUserMedia-start", { isTab: isTab.current });
let stream;
@@ -1787,11 +2091,13 @@ const Recorder = () => {
if (stream.getVideoTracks().length === 0) {
debugError("No video tracks returned from getUserMedia");
+ resetGateState();
sendRecordingError("No video tracks available");
return;
}
} catch (err) {
debugError("Failed to get user media for desktop/tab capture", err);
+ resetGateState();
sendRecordingError("Failed to get user media: " + String(err));
return;
}
@@ -1800,6 +2106,12 @@ const Recorder = () => {
videoTracks: stream.getVideoTracks().length,
audioTracks: stream.getAudioTracks().length,
});
+ slLog("getUserMedia-resolved", {
+ videoTracks: stream.getVideoTracks().length,
+ audioTracks: stream.getAudioTracks().length,
+ streamId: stream.id,
+ trackState: stream.getVideoTracks()[0]?.readyState,
+ });
if (isTab.current) {
const output = new AudioContext();
@@ -1809,6 +2121,7 @@ const Recorder = () => {
}
helperVideoStream.current = stream;
+ slLog("helperVideoStream-assigned", { path: "desktop/tab", streamId: stream.id });
const surface = stream.getVideoTracks()[0].getSettings().displaySurface;
debug("Display surface", surface);
@@ -1854,6 +2167,7 @@ const Recorder = () => {
const helperVideoTrack = helperVideoStream.current.getVideoTracks()[0];
if (!helperVideoTrack) {
+ resetGateState();
sendRecordingError("Display stream missing video track");
return;
}
@@ -1888,14 +2202,27 @@ const Recorder = () => {
});
setStarted(true);
+ streamReadyAt.current = Date.now();
+ slLog("stream-ready", {
+ streamId: helperVideoStream.current?.id,
+ videoTracks: helperVideoStream.current?.getVideoTracks().length,
+ trackState: helperVideoStream.current?.getVideoTracks()[0]?.readyState,
+ startRequested: startRequested.current,
+ });
await warmUpStream(liveStream.current);
+ slLog("warmUp-done");
chrome.runtime.sendMessage({ type: "reset-active-tab" });
+ slLog("reset-active-tab-sent");
+
+ // If a start was already requested, honour it now that the stream is live.
+ tryStartIfReady();
}
async function startStreaming(data) {
debug("startStreaming()", { data });
+ slLog("startStreaming-enter", { recordingType: data?.recordingType });
const permissions = await navigator.permissions.query({
name: "camera",
});
@@ -1921,10 +2248,12 @@ const Recorder = () => {
captureTypes,
tabPreferred: tabPreferred.current,
});
+ slLog("chooseDesktopMedia-show");
chrome.desktopCapture.chooseDesktopMedia(
captureTypes,
null,
(streamId, options) => {
+ slLog("chooseDesktopMedia-picked", { hasStreamId: !!streamId });
debug("chooseDesktopMedia callback", { streamId, options });
if (
streamId === undefined ||
@@ -1932,6 +2261,7 @@ const Recorder = () => {
streamId === ""
) {
debugWarn("User cancelled the desktop capture modal");
+ resetGateState();
sendRecordingError("User cancelled the modal", true);
return;
} else {
@@ -1943,6 +2273,7 @@ const Recorder = () => {
const tabStreamId = await waitForTabStreamId();
debug("Streaming with pre-resolved tabID", tabStreamId);
if (!tabStreamId) {
+ resetGateState();
sendRecordingError("Unable to resolve tab stream id", true);
return;
}
@@ -1950,6 +2281,7 @@ const Recorder = () => {
}
} catch (err) {
debugError("startStreaming() error", err);
+ resetGateState();
sendRecordingError("Failed to start streaming: " + String(err), true);
}
}
@@ -1983,6 +2315,12 @@ const Recorder = () => {
useEffect(() => {
return () => {
debug("Component unmounting - cleaning up");
+ slLog("component-unmount", {
+ hadStream: !!helperVideoStream.current,
+ started,
+ startRequested: startRequested.current,
+ });
+ resetGateState();
stopTabKeepAlive();
stopSessionHeartbeat();
};
@@ -2011,129 +2349,162 @@ const Recorder = () => {
};
}, []);
- const onMessage = useCallback(
- (request, sender, sendResponse) => {
- if (DEBUG_RECORDER) {
- debug("onMessage()", request.type, { request, sender });
- }
+ // Message handler — registered once on mount; uses refs so closure stays fresh.
+ const onMessageRef = useRef(null);
+ onMessageRef.current = (request, sender, sendResponse) => {
+ if (DEBUG_RECORDER) {
+ debug("onMessage()", request.type, { request, sender });
+ }
- if (request.type === "loaded") {
- backupRef.current = request.backup;
- if (!tabPreferred.current) {
- isTab.current = request.isTab;
- if (request.isTab) {
- getStreamID(request.tabID);
- }
- } else {
- isTab.current = false;
- }
- chrome.runtime.sendMessage({ type: "get-streaming-data" });
- } else if (request.type === "streaming-data") {
- startStreaming(JSON.parse(request.data));
- } else if (request.type === "start-recording-tab") {
- if (isRestarting.current) {
- // Restart teardown can overlap with background's start dispatch.
- // Queue one start so we begin immediately after cleanup completes.
- pendingStartAfterRestart.current = true;
- debug("Queued start-recording-tab while restarting");
- return;
+ if (request.type === "loaded") {
+ slLog("msg-loaded");
+ backupRef.current = request.backup;
+ if (!tabPreferred.current) {
+ isTab.current = request.isTab;
+ if (request.isTab) {
+ getStreamID(request.tabID);
}
- startRecording();
- } else if (request.type === "restart-recording-tab") {
- if (isRestarting.current) {
- sendResponse?.({ ok: false, error: "restart-in-progress" });
- return true;
- }
- pendingStartAfterRestart.current = false;
- Promise.resolve(restartRecording())
- .then((restarted) => {
- if (!restarted) {
- sendResponse?.({ ok: false, error: "restart-teardown-failed" });
- return;
- }
- sendResponse?.({ ok: true, restarted: true });
- })
- .catch((error) => {
- sendResponse?.({
- ok: false,
- error: error?.message || String(error),
- });
- });
+ } else {
+ isTab.current = false;
+ }
+ chrome.runtime.sendMessage({ type: "get-streaming-data" });
+ } else if (request.type === "streaming-data") {
+ slLog("msg-streaming-data");
+ startStreaming(JSON.parse(request.data));
+ } else if (request.type === "start-recording-tab") {
+ slLog("msg-start-recording-tab", {
+ hasStream: !!helperVideoStream.current,
+ streamReady: getStreamReadiness(),
+ isRestarting: isRestarting.current,
+ docHidden: document.hidden,
+ docVisibility: document.visibilityState,
+ });
+ // Request start via the readiness gate.
+ requestStart();
+ } else if (request.type === "restart-recording-tab") {
+ if (isRestarting.current) {
+ sendResponse?.({ ok: false, error: "restart-in-progress" });
return true;
- } else if (request.type === "stop-recording-tab") {
- stopRecording();
- } else if (request.type === "set-mic-active-tab") {
- setMic(request);
- } else if (request.type === "set-audio-output-volume") {
- setAudioOutputVolume(request.volume);
- } else if (request.type === "pause-recording-tab") {
- if (!recorder.current) return;
- if (pausedStateRef.current) return;
- if (
- useWebCodecs.current &&
- recorder.current instanceof WebCodecsRecorder
- ) {
- debug("Pausing WebCodecsRecorder");
- recorder.current.pause();
- } else if (recorder.current instanceof MediaRecorder) {
- debug("Pausing MediaRecorder");
- recorder.current.pause();
- }
- const now = Date.now();
- pausedStateRef.current = true;
- void setRecordingTimingState({
- paused: true,
- pausedAt: now,
- });
- } else if (request.type === "resume-recording-tab") {
- if (!recorder.current) return;
- if (!pausedStateRef.current) return;
- if (
- useWebCodecs.current &&
- recorder.current instanceof WebCodecsRecorder
- ) {
- debug("Resuming WebCodecsRecorder");
- recorder.current.resume();
- } else if (recorder.current instanceof MediaRecorder) {
- debug("Resuming MediaRecorder");
- recorder.current.resume();
- }
- const now = Date.now();
- pausedStateRef.current = false;
- void (async () => {
- try {
- const { pausedAt, totalPausedMs } = await chrome.storage.local.get([
- "pausedAt",
- "totalPausedMs",
- ]);
- const additional = pausedAt ? Math.max(0, now - pausedAt) : 0;
- await setRecordingTimingState({
- paused: false,
- pausedAt: null,
- totalPausedMs: (totalPausedMs || 0) + additional,
- });
- } catch (err) {
- debugWarn("Failed to update resume timing state", err);
+ }
+ pendingStartAfterRestart.current = false;
+ Promise.resolve(restartRecording())
+ .then((restarted) => {
+ if (!restarted) {
+ sendResponse?.({ ok: false, error: "restart-teardown-failed" });
+ return;
}
- })();
- } else if (request.type === "dismiss-recording") {
- dismissRecording();
+ sendResponse?.({ ok: true, restarted: true });
+ })
+ .catch((error) => {
+ sendResponse?.({
+ ok: false,
+ error: error?.message || String(error),
+ });
+ });
+ return true;
+ } else if (request.type === "stop-recording-tab") {
+ stopRecording();
+ sendResponse?.({ ok: true });
+ return true;
+ } else if (request.type === "set-mic-active-tab") {
+ setMic(request);
+ } else if (request.type === "set-audio-output-volume") {
+ setAudioOutputVolume(request.volume);
+ } else if (request.type === "pause-recording-tab") {
+ if (!recorder.current) return;
+ if (pausedStateRef.current) return;
+ if (
+ useWebCodecs.current &&
+ recorder.current instanceof WebCodecsRecorder
+ ) {
+ debug("Pausing WebCodecsRecorder");
+ recorder.current.pause();
+ } else if (recorder.current instanceof MediaRecorder) {
+ debug("Pausing MediaRecorder");
+ recorder.current.pause();
}
- },
- [recorder.current, tabPreferred.current],
- );
+ const now = Date.now();
+ pausedStateRef.current = true;
+ void setRecordingTimingState({
+ paused: true,
+ pausedAt: now,
+ });
+ } else if (request.type === "resume-recording-tab") {
+ if (!recorder.current) return;
+ if (!pausedStateRef.current) return;
+ if (
+ useWebCodecs.current &&
+ recorder.current instanceof WebCodecsRecorder
+ ) {
+ debug("Resuming WebCodecsRecorder");
+ recorder.current.resume();
+ } else if (recorder.current instanceof MediaRecorder) {
+ debug("Resuming MediaRecorder");
+ recorder.current.resume();
+ }
+ const now = Date.now();
+ pausedStateRef.current = false;
+ void (async () => {
+ try {
+ const { pausedAt, totalPausedMs } = await chrome.storage.local.get([
+ "pausedAt",
+ "totalPausedMs",
+ ]);
+ const additional = pausedAt ? Math.max(0, now - pausedAt) : 0;
+ await setRecordingTimingState({
+ paused: false,
+ pausedAt: null,
+ totalPausedMs: (totalPausedMs || 0) + additional,
+ });
+ } catch (err) {
+ debugWarn("Failed to update resume timing state", err);
+ }
+ })();
+ } else if (request.type === "dismiss-recording") {
+ dismissRecording();
+ }
+ };
+ // Stable wrapper — delegates to the ref so the listener never changes.
useEffect(() => {
- debug("Adding chrome.runtime.onMessage listener");
- chrome.runtime.onMessage.addListener(onMessage);
+ const stableHandler = (request, sender, sendResponse) => {
+ return onMessageRef.current?.(request, sender, sendResponse);
+ };
+ debug("Adding chrome.runtime.onMessage listener (stable)");
+ slLog("listener-add");
+ chrome.runtime.onMessage.addListener(stableHandler);
return () => {
- debug("Removing chrome.runtime.onMessage listener");
- chrome.runtime.onMessage.removeListener(onMessage);
+ debug("Removing chrome.runtime.onMessage listener (stable)");
+ slLog("listener-remove");
+ chrome.runtime.onMessage.removeListener(stableHandler);
};
- }, [onMessage]);
+ }, []);
- return <RecorderUI started={started} isTab={isTab.current} />;
+ return (
+ <>
+ <RecorderUI started={started} isTab={isTab.current} />
+ {process.env.SCREENITY_DEV_MODE === "true" && (
+ <div
+ style={{
+ position: "fixed",
+ top: 4,
+ right: 4,
+ zIndex: 2147483647,
+ background: "rgba(0,0,0,0.65)",
+ color: "#0f0",
+ fontSize: "10px",
+ padding: "3px 7px",
+ borderRadius: "4px",
+ fontFamily: "monospace",
+ pointerEvents: "none",
+ }}
+ >
+ DEV
+ </div>
+ )}
+ </>
+ );
};
export default Recorder;
diff --git a/src/pages/Recorder/messaging.js b/src/pages/Recorder/messaging.js
index 47c3f36..763d207 100644
--- a/src/pages/Recorder/messaging.js
+++ b/src/pages/Recorder/messaging.js
@@ -1,14 +1,22 @@
+import { classifyError } from "../utils/errorCodes";
+
export function sendRecordingError(why, cancel = false) {
+ const errorType = !cancel ? "stream-error" : "cancel-modal";
+ const whyStr = typeof why === "string" ? why : JSON.stringify(why);
+ const errorCode = classifyError(whyStr, errorType);
+
chrome.runtime.sendMessage({
type: "recording-error",
- error: !cancel ? "stream-error" : "cancel-modal",
- why: typeof why === "string" ? why : JSON.stringify(why),
+ error: errorType,
+ why: whyStr,
+ errorCode,
});
}
-export function sendStopRecording(reason = "generic") {
+export function sendStopRecording(reason = "generic", extra = {}) {
chrome.runtime.sendMessage({
type: "stop-recording-tab",
reason,
+ ...extra,
});
}
diff --git a/src/pages/Recorder/webcodecs/Mp4MuxerWrapper.ts b/src/pages/Recorder/webcodecs/Mp4MuxerWrapper.ts
index b16d990..4caacb9 100644
--- a/src/pages/Recorder/webcodecs/Mp4MuxerWrapper.ts
+++ b/src/pages/Recorder/webcodecs/Mp4MuxerWrapper.ts
@@ -84,12 +84,16 @@ export class Mp4MuxerWrapper {
addVideoChunk(chunk: EncodedVideoChunk, meta: any) {
if (meta?.decoderConfig) {
this._lastDecoderConfig = meta.decoderConfig;
- } else if (!meta.decoderConfig && this._lastDecoderConfig) {
- meta.decoderConfig = this._lastDecoderConfig;
}
- const packet = this.buildPacket(chunk, meta, "video");
- return this.videoSource.add(packet, meta);
+ // Meta is read-only — supply cached decoderConfig when the chunk lacks one.
+ const effectiveMeta =
+ !meta?.decoderConfig && this._lastDecoderConfig
+ ? { ...meta, decoderConfig: this._lastDecoderConfig }
+ : meta;
+
+ const packet = this.buildPacket(chunk, effectiveMeta, "video");
+ return this.videoSource.add(packet, effectiveMeta);
}
addAudioChunk(chunk: EncodedAudioChunk, meta: any) {
@@ -117,9 +121,9 @@ export class Mp4MuxerWrapper {
}
}
- setPausedOffset(offsetUs: number) {
- this.pausedOffsetUs = offsetUs;
- }
+ // No-op: WebCodecsRecorder already subtracts paused time from timestamps,
+ // so a second subtraction here would break monotonicity. Kept for API compat.
+ setPausedOffset(_offsetUs: number) {}
setAudioOffset(offsetUs: number) {
this.audioTimestampOffsetUs = offsetUs;
@@ -159,6 +163,8 @@ export class Mp4MuxerWrapper {
const last = (this as any)[key] ?? 0;
if (type === "audio") {
+ // Audio ts is already monotonic from WebCodecsRecorder's sample counter.
+ // Just accumulate for logging.
const next = last + durationUs;
(this as any)[key] = next;
this.log(`[MUX] audio ts +${durationUs} => ${next}`);
@@ -172,13 +178,16 @@ export class Mp4MuxerWrapper {
return fallback;
}
+ // Pin offset to the first frame so output starts at 0.
+ // Don't subtract pausedOffsetUs — WebCodecsRecorder already excludes
+ // paused time, and double-subtracting breaks monotonicity.
if (this.videoTimestampOffsetUs == null) {
this.videoTimestampOffsetUs = timestampUs;
}
const relative = Math.max(
0,
- timestampUs - this.videoTimestampOffsetUs - this.pausedOffsetUs
+ timestampUs - this.videoTimestampOffsetUs
);
(this as any)[key] = relative;
diff --git a/src/pages/Recorder/webcodecs/WebCodecsRecorder.js b/src/pages/Recorder/webcodecs/WebCodecsRecorder.js
index 7b82fe1..1c3c4f0 100644
--- a/src/pages/Recorder/webcodecs/WebCodecsRecorder.js
+++ b/src/pages/Recorder/webcodecs/WebCodecsRecorder.js
@@ -216,12 +216,8 @@ export class WebCodecsRecorder {
this.audioReader = this.audioProcessor.readable.getReader();
}
- if (this.audioReader && this.options.enableAudio) {
- this.log("[WCR] start buffering audio");
- this._audioLoopPromise = this.readAudioLoop();
- }
-
- // Make sure audio encoder is ready before first video chunk
+ // Init audio encoder first so _audioReady=true when both loops
+ // launch together — avoids audio prebuffering before video starts.
if (this._pendingAudioConfig) {
await this.initAudioEncoder(this._pendingAudioConfig);
this._audioReady = true;
@@ -256,7 +252,12 @@ export class WebCodecsRecorder {
await Promise.resolve();
setTimeout(() => {
+ // Start both loops together so t=0 is aligned.
this._videoLoopPromise = this.readVideoLoop();
+ if (this.audioReader && this.options.enableAudio) {
+ this.log("[WCR] start audio loop (aligned with video)");
+ this._audioLoopPromise = this.readAudioLoop();
+ }
if (this._startResolve) {
this._startResolve(true);
@@ -393,6 +394,14 @@ export class WebCodecsRecorder {
this.audioEncoder?.close();
} catch {}
+ // Release any AudioData objects that were queued before the audio encoder
+ // was ready. If encoder init failed, these would otherwise be held in
+ // memory indefinitely because readAudioLoop never drained the buffer.
+ for (const item of this._prebufferedAudio) {
+ try { item.close?.(); } catch {}
+ }
+ this._prebufferedAudio = [];
+
this.videoProcessor = null;
this.audioProcessor = null;
this.videoReader = null;
@@ -580,6 +589,20 @@ export class WebCodecsRecorder {
continue;
}
+ // If the tab was hidden or the system was heavily loaded, we can end
+ // up many frames behind wall-clock. Filling the entire gap in one
+ // iteration would create hundreds of VideoFrames synchronously and
+ // overflow the encoder's internal queue. Instead, skip ahead to at
+ // most MAX_GAP_FRAMES behind the target so the burst is bounded.
+ // The skipped indices advance _videoFrameIndex, preventing repeated
+ // catch-up attempts on the next iteration.
+ const MAX_GAP_FRAMES = 8; // ≈ 267 ms at 30 fps
+ const gap = targetIndex - this._videoFrameIndex;
+ if (gap > MAX_GAP_FRAMES) {
+ this.warn(`[WCR] skipping ${gap - MAX_GAP_FRAMES} frames (tab gap)`);
+ this._videoFrameIndex = targetIndex - MAX_GAP_FRAMES;
+ }
+
const startIndex = this._videoFrameIndex;
const endIndex = targetIndex;
for (let i = startIndex; i <= endIndex; i += 1) {
@@ -672,6 +695,15 @@ export class WebCodecsRecorder {
continue;
}
+ // Drop audio data while the recording is paused. The sample counter
+ // is not advanced, so audio timestamps resume from the correct
+ // active-recording position when resume() is called — keeping audio
+ // and video aligned across any number of pause/resume cycles.
+ if (this.paused) {
+ audioData.close?.();
+ continue;
+ }
+
try {
if (this._prebufferedAudio.length) {
while (this._prebufferedAudio.length) {
diff --git a/src/pages/RecorderOffscreen/RecorderOffscreen.jsx b/src/pages/RecorderOffscreen/RecorderOffscreen.jsx
index 4b62947..4374c85 100644
--- a/src/pages/RecorderOffscreen/RecorderOffscreen.jsx
+++ b/src/pages/RecorderOffscreen/RecorderOffscreen.jsx
@@ -98,6 +98,13 @@ const RecorderOffscreen = () => {
}
if (!(await canFitChunk(e.data.size))) {
+ if (!lowStorageAbort.current) {
+ chrome.runtime.sendMessage({
+ type: "show-toast",
+ message: chrome.i18n.getMessage("toastStorageCritical"),
+ timeout: 8000,
+ });
+ }
lowStorageAbort.current = true;
chrome.storage.local.set({
recording: false,
@@ -116,6 +123,13 @@ const RecorderOffscreen = () => {
timestamp: ts,
});
} catch (err) {
+ if (!lowStorageAbort.current) {
+ chrome.runtime.sendMessage({
+ type: "show-toast",
+ message: chrome.i18n.getMessage("toastStorageCritical"),
+ timeout: 8000,
+ });
+ }
lowStorageAbort.current = true;
chrome.storage.local.set({
recording: false,
@@ -153,6 +167,13 @@ const RecorderOffscreen = () => {
pendingBytes.current -= e.data.size;
if (!(await canFitChunk(e.data.size))) {
+ if (!lowStorageAbort.current) {
+ chrome.runtime.sendMessage({
+ type: "show-toast",
+ message: chrome.i18n.getMessage("toastStorageCritical"),
+ timeout: 8000,
+ });
+ }
lowStorageAbort.current = true;
chrome.storage.local.set({
recording: false,
@@ -898,6 +919,8 @@ const RecorderOffscreen = () => {
return true;
} else if (request.type === "stop-recording-tab") {
stopRecording();
+ sendResponse?.({ ok: true });
+ return true;
} else if (request.type === "set-mic-active-tab") {
setMic(request);
} else if (request.type === "set-audio-output-volume") {
@@ -937,6 +960,17 @@ const RecorderOffscreen = () => {
);
}
})();
+ } else if (request.type === "play-beep-offscreen") {
+ // Reuse this offscreen document for beep sounds so Chrome doesn't
+ // need to create a second offscreen document (only one is allowed).
+ try {
+ const audioUrl = chrome.runtime.getURL("assets/sounds/beep.mp3");
+ const audio = new Audio(audioUrl);
+ audio.volume = 0.5;
+ audio.play().catch(() => {});
+ } catch {}
+ sendResponse?.({ ok: true });
+ return true;
} else if (request.type === "dismiss-recording") {
dismissRecording();
}
diff --git a/src/pages/Region/Recorder.jsx b/src/pages/Region/Recorder.jsx
index 23be597..d3a0b60 100644
--- a/src/pages/Region/Recorder.jsx
+++ b/src/pages/Region/Recorder.jsx
@@ -228,6 +228,13 @@ const Recorder = () => {
// }
if (!(await canFitChunk(e.data.size))) {
+ if (!lowStorageAbort.current) {
+ chrome.runtime.sendMessage({
+ type: "show-toast",
+ message: chrome.i18n.getMessage("toastStorageCritical"),
+ timeout: 8000,
+ });
+ }
lowStorageAbort.current = true;
chrome.storage.local.set({
recording: false,
@@ -248,6 +255,13 @@ const Recorder = () => {
timestamp: ts,
});
} catch (err) {
+ if (!lowStorageAbort.current) {
+ chrome.runtime.sendMessage({
+ type: "show-toast",
+ message: chrome.i18n.getMessage("toastStorageCritical"),
+ timeout: 8000,
+ });
+ }
lowStorageAbort.current = true;
chrome.storage.local.set({
recording: false,
@@ -330,6 +344,13 @@ const Recorder = () => {
pendingBytes.current -= e.data.size;
if (!(await canFitChunk(e.data.size))) {
+ if (!lowStorageAbort.current) {
+ chrome.runtime.sendMessage({
+ type: "show-toast",
+ message: chrome.i18n.getMessage("toastStorageCritical"),
+ timeout: 8000,
+ });
+ }
lowStorageAbort.current = true;
chrome.storage.local.set({
recording: false,
@@ -1054,6 +1075,9 @@ const Recorder = () => {
if (switched && recorder.current instanceof MediaRecorder) {
try {
recorder.current.start(1000);
+ setTimeout(() => {
+ try { recorder.current?.requestData?.(); } catch (_) {}
+ }, 250);
} catch (startErr) {
persistRegionStartDebug({
stage: "codec-fallback-start-failed",
@@ -1145,6 +1169,11 @@ const Recorder = () => {
if (isMediaRecorder) {
try {
recorder.current.start(1000);
+ // Force an early first chunk so even very short recordings have
+ // data in IndexedDB before the user can navigate away.
+ setTimeout(() => {
+ try { recorder.current?.requestData?.(); } catch (_) {}
+ }, 250);
} catch (err) {
persistRegionStartDebug({
stage: "mediarecorder-start-throw",
@@ -1703,16 +1732,39 @@ const Recorder = () => {
useEffect(() => {
const handleBeforeUnload = (e) => {
if (recordingRef.current && regionRef.current) {
+ // Flush any buffered data from the MediaRecorder into IndexedDB.
+ // The "Leave page?" dialog gives the ondataavailable handler enough
+ // time to persist the chunk before the frame is torn down.
+ try {
+ recorder.current?.requestData?.();
+ } catch (_) {}
e.preventDefault();
e.returnValue = "";
-
- // Save and stop recording
- stopRecording();
}
};
window.addEventListener("beforeunload", handleBeforeUnload);
+
+ // When the iframe is actually being destroyed (user clicked "Leave" or
+ // the parent page navigated), fire a message to the background to force
+ // stop the recording. pagehide fires synchronously during teardown and
+ // chrome.runtime.sendMessage from an extension page is delivered via IPC
+ // before the frame is gone — no async race.
+ const handlePageHide = () => {
+ if (recordingRef.current && regionRef.current) {
+ try {
+ chrome.runtime.sendMessage({
+ type: "region-iframe-destroyed",
+ });
+ } catch (_) {
+ // Extension context may already be invalidated
+ }
+ }
+ };
+ window.addEventListener("pagehide", handlePageHide);
+
return () => {
window.removeEventListener("beforeunload", handleBeforeUnload);
+ window.removeEventListener("pagehide", handlePageHide);
};
}, []);
@@ -1825,7 +1877,29 @@ const Recorder = () => {
};
}, []);
- return <div></div>;
+ return (
+ <div>
+ {process.env.SCREENITY_DEV_MODE === "true" && (
+ <div
+ style={{
+ position: "fixed",
+ top: 4,
+ right: 4,
+ zIndex: 2147483647,
+ background: "rgba(0,0,0,0.65)",
+ color: "#0f0",
+ fontSize: "10px",
+ padding: "3px 7px",
+ borderRadius: "4px",
+ fontFamily: "monospace",
+ pointerEvents: "none",
+ }}
+ >
+ DEV
+ </div>
+ )}
+ </div>
+ );
};
export default Recorder;
diff --git a/src/pages/Sandbox/DevHUD.jsx b/src/pages/Sandbox/DevHUD.jsx
new file mode 100644
index 0000000..e37ba9e
--- /dev/null
+++ b/src/pages/Sandbox/DevHUD.jsx
@@ -0,0 +1,245 @@
+import React, { useState } from "react";
+
+const BTN = {
+ padding: "4px 8px",
+ fontSize: "11px",
+ border: "1px solid rgba(255,255,255,0.2)",
+ borderRadius: "4px",
+ background: "rgba(0,0,0,0.6)",
+ color: "#fff",
+ cursor: "pointer",
+ whiteSpace: "nowrap",
+};
+const BTN_RESET = { ...BTN, background: "rgba(200,50,50,0.7)" };
+const Z = 2147483647;
+
+const DevHUD = ({ setContentState, contentStateRef }) => {
+ const [collapsed, setCollapsed] = useState(true);
+
+ if (collapsed) {
+ return (
+ <div
+ onClick={() => setCollapsed(false)}
+ style={{
+ position: "fixed",
+ top: 6,
+ right: 6,
+ zIndex: Z,
+ background: "rgba(0,0,0,0.65)",
+ color: "#0f0",
+ fontSize: "10px",
+ padding: "3px 7px",
+ borderRadius: "4px",
+ cursor: "pointer",
+ fontFamily: "monospace",
+ }}
+ >
+ DEV
+ </div>
+ );
+ }
+
+ const actions = [
+ {
+ label: "Stuck processing",
+ fn: () =>
+ setContentState((p) => ({
+ ...p,
+ ready: false,
+ processingProgress: 0,
+ })),
+ },
+ {
+ label: "Processing 50%",
+ fn: () =>
+ setContentState((p) => ({
+ ...p,
+ ready: false,
+ processingProgress: 50,
+ })),
+ },
+ {
+ label: "Recovery mode",
+ fn: () =>
+ setContentState((p) => ({
+ ...p,
+ fallback: true,
+ noffmpeg: true,
+ editLimit: 3600,
+ ready: true,
+ editErrorType: null,
+ offline: false,
+ webm: p.webm || p.rawBlob || p.blob,
+ })),
+ },
+ {
+ label: "Long recording",
+ fn: () =>
+ setContentState((p) => ({
+ ...p,
+ fallback: true,
+ noffmpeg: true,
+ editLimit: 0,
+ ready: true,
+ editErrorType: null,
+ offline: false,
+ webm: p.webm || p.rawBlob || p.blob,
+ })),
+ },
+ {
+ label: "Encoding (FFmpeg)",
+ fn: () =>
+ setContentState((p) => ({
+ ...p,
+ ready: true,
+ isFfmpegRunning: true,
+ mp4ready: false,
+ noffmpeg: false,
+ fallback: false,
+ editErrorType: null,
+ offline: false,
+ duration: Math.min(p.duration || 10, p.editLimit || 3600),
+ })),
+ },
+ {
+ label: "MP4 not ready",
+ fn: () =>
+ setContentState((p) => ({
+ ...p,
+ ready: true,
+ mp4ready: false,
+ isFfmpegRunning: false,
+ noffmpeg: false,
+ fallback: false,
+ editErrorType: null,
+ offline: false,
+ duration: Math.min(p.duration || 10, p.editLimit || 3600),
+ })),
+ },
+ {
+ label: "Edit timeout",
+ fn: () =>
+ setContentState((p) => ({
+ ...p,
+ editErrorType: "timeout",
+ fallback: false,
+ })),
+ },
+ {
+ label: "Edit failed",
+ fn: () =>
+ setContentState((p) => ({
+ ...p,
+ editErrorType: "failed",
+ fallback: false,
+ })),
+ },
+ {
+ label: "Edit too long",
+ fn: () =>
+ setContentState((p) => ({
+ ...p,
+ editErrorType: "too-long",
+ fallback: false,
+ })),
+ },
+ {
+ label: "Offline",
+ fn: () =>
+ setContentState((p) => ({
+ ...p,
+ offline: true,
+ fallback: false,
+ })),
+ },
+ {
+ label: "Memory limit modal",
+ fn: () => {
+ contentStateRef.current?.openModal?.(
+ chrome.i18n.getMessage("memoryLimitTitle"),
+ chrome.i18n.getMessage("memoryLimitDescription"),
+ chrome.i18n.getMessage("understoodButton"),
+ null,
+ () => {},
+ () => {}
+ );
+ },
+ },
+ {
+ label: "Having issues modal",
+ fn: () => {
+ contentStateRef.current?.openModal?.(
+ chrome.i18n.getMessage("havingIssuesModalTitle"),
+ chrome.i18n.getMessage("havingIssuesModalDescription"),
+ chrome.i18n.getMessage("restoreRecording"),
+ chrome.i18n.getMessage("havingIssuesModalButton2"),
+ () => {},
+ () => {}
+ );
+ },
+ },
+ ];
+
+ return (
+ <div
+ style={{
+ position: "fixed",
+ top: 6,
+ right: 6,
+ zIndex: Z,
+ background: "rgba(20,20,20,0.9)",
+ borderRadius: "6px",
+ padding: "8px",
+ display: "flex",
+ flexDirection: "column",
+ gap: "4px",
+ fontFamily: "monospace",
+ maxWidth: "160px",
+ maxHeight: "90vh",
+ overflowY: "auto",
+ }}
+ >
+ <div
+ style={{
+ display: "flex",
+ justifyContent: "space-between",
+ alignItems: "center",
+ marginBottom: "2px",
+ }}
+ >
+ <span style={{ color: "#0f0", fontSize: "10px" }}>DEV HUD</span>
+ <span
+ onClick={() => setCollapsed(true)}
+ style={{ color: "#888", fontSize: "12px", cursor: "pointer" }}
+ >
+ x
+ </span>
+ </div>
+ {actions.map((a) => (
+ <button key={a.label} style={BTN} onClick={a.fn}>
+ {a.label}
+ </button>
+ ))}
+ <button
+ style={BTN_RESET}
+ onClick={() =>
+ setContentState((p) => ({
+ ...p,
+ ready: true,
+ fallback: false,
+ noffmpeg: false,
+ editErrorType: null,
+ isFfmpegRunning: false,
+ mp4ready: true,
+ offline: false,
+ processingProgress: 0,
+ }))
+ }
+ >
+ Reset
+ </button>
+ </div>
+ );
+};
+
+export default DevHUD;
diff --git a/src/pages/Sandbox/Sandbox.jsx b/src/pages/Sandbox/Sandbox.jsx
index f811076..ce3abab 100644
--- a/src/pages/Sandbox/Sandbox.jsx
+++ b/src/pages/Sandbox/Sandbox.jsx
@@ -192,6 +192,17 @@ const Sandbox = () => {
() => {
chrome.runtime.sendMessage({ type: "report-bug" });
},
+ null, // image
+ null, // learnMore
+ null, // learnMoreLink
+ false, // colorSafe
+ chrome.i18n.getMessage("getHelpButton"),
+ () => {
+ chrome.runtime.sendMessage({
+ type: "report-error",
+ source: "processing-stuck",
+ });
+ },
);
}}
>
diff --git a/src/pages/Sandbox/context/ContentState.jsx b/src/pages/Sandbox/context/ContentState.jsx
index a00967d..2e28854 100644
--- a/src/pages/Sandbox/context/ContentState.jsx
+++ b/src/pages/Sandbox/context/ContentState.jsx
@@ -11,6 +11,7 @@ import fixWebmDuration from "fix-webm-duration";
import { default as fixWebmDurationFallback } from "webm-duration-fix";
import localforage from "localforage";
+import DevHUD from "../DevHUD";
import {
formatLocalTimestamp,
getHostnameFromUrl,
@@ -37,7 +38,7 @@ export const ContentStateContext = createContext();
const DEBUG_RECORDER =
typeof window !== "undefined" ? !!window.SCREENITY_DEBUG_RECORDER : false;
// Enable post-stop debug logs for sandbox
-const DEBUG_POSTSTOP = true;
+const DEBUG_POSTSTOP = DEBUG_RECORDER;
const ContentState = (props) => {
const videoChunks = useRef([]);
@@ -45,6 +46,9 @@ const ContentState = (props) => {
const chunkCount = useRef(0);
const recdbgSessionRef = useRef(null);
const tabIdRef = useRef(null);
+ // Stale-result guard + stuck-edit watchdog.
+ const opIdRef = useRef(0);
+ const editWatchdogRef = useRef(null);
useEffect(() => {
if (!DEBUG_RECORDER && !isRecordingDebugEnabled()) return;
@@ -101,6 +105,7 @@ const ContentState = (props) => {
trimming: false,
cutting: false,
muting: false,
+ editErrorType: null, // null | "too-long" | "timeout" | "failed"
history: [{}], // Initialize history with a default state
redoHistory: [],
undoDisabled: true,
@@ -557,11 +562,38 @@ const ContentState = (props) => {
}, [contentState.blob]);
const reconstructVideo = async (withBlob) => {
+ // Sniff MIME type from magic bytes (WebCodecs chunks are MP4, not WebM).
+ let inferredType = "video/webm; codecs=vp8,opus";
+ if (!withBlob && videoChunks.current.length > 0) {
+ try {
+ const head = videoChunks.current[0];
+ if (head && head.length >= 8) {
+ const magic = new TextDecoder().decode(head.slice(4, 8));
+ if (magic === "ftyp") {
+ inferredType = "video/mp4";
+ }
+ if (DEBUG_RECORDER)
+ console.log("[Screenity][Sandbox] reconstructVideo inferred type", {
+ magic,
+ inferredType,
+ chunkCount: videoChunks.current.length,
+ totalSize: videoChunks.current.reduce((s, c) => s + c.length, 0),
+ });
+ }
+ } catch (e) {
+ console.warn("[Screenity][Sandbox] reconstructVideo type sniff failed", e);
+ }
+ }
+
let blob = withBlob
? withBlob
- : new Blob(videoChunks.current, { type: "video/webm; codecs=vp8,opus" });
+ : new Blob(videoChunks.current, { type: inferredType });
if (blob.type === "video/mp4") {
+ if (DEBUG_RECORDER)
+ console.log("[Screenity][Sandbox] reconstructVideo: fast MP4 path taken", {
+ size: blob.size,
+ });
//const TOO_BIG_BYTES = 200 * 1024 * 1024;
// const TOO_BIG_BYTES = 0;
// if (blob.size > TOO_BIG_BYTES) {
@@ -618,13 +650,52 @@ const ContentState = (props) => {
video.src = URL.createObjectURL(blob);
chrome.runtime.sendMessage({ type: "recording-complete" });
+ chrome.runtime.sendMessage({ type: "diag-editor-ready", path: "mp4-fast" }).catch(() => {});
return;
}
- const { recordingDuration } = await chrome.storage.local.get(
+ let { recordingDuration } = await chrome.storage.local.get(
"recordingDuration",
);
+ // If recordingDuration is missing or 0, try to probe it from the blob
+ if (!recordingDuration || recordingDuration <= 0) {
+ console.warn(
+ "[Screenity][WebM] recordingDuration missing or 0, probing from blob",
+ );
+ try {
+ const probeDuration = await new Promise((resolve) => {
+ const probe = document.createElement("video");
+ probe.preload = "metadata";
+ const timeout = setTimeout(() => {
+ URL.revokeObjectURL(probe.src);
+ resolve(0);
+ }, 5000);
+ probe.onloadedmetadata = () => {
+ clearTimeout(timeout);
+ const dur = probe.duration;
+ URL.revokeObjectURL(probe.src);
+ if (Number.isFinite(dur) && dur > 0) {
+ resolve(Math.round(dur * 1000));
+ } else {
+ resolve(0);
+ }
+ };
+ probe.onerror = () => {
+ clearTimeout(timeout);
+ URL.revokeObjectURL(probe.src);
+ resolve(0);
+ };
+ probe.src = URL.createObjectURL(blob);
+ });
+ if (probeDuration > 0) {
+ recordingDuration = probeDuration;
+ }
+ } catch (err) {
+ console.warn("[Screenity][WebM] blob duration probe failed:", err);
+ }
+ }
+
// Check if token is present
const { token } = await chrome.storage.local.get("token");
@@ -634,21 +705,22 @@ const ContentState = (props) => {
driveEnabled = true;
}
+ const safeDuration = Number(recordingDuration) || 0;
setContentState((prevState) => ({
...prevState,
rawBlob: blob,
- duration: recordingDuration / 1000,
+ duration: safeDuration / 1000,
}));
// Check if user is in Windows 10
const isWindows10 = navigator.userAgent.match(/Windows NT 10.0/);
try {
- if (recordingDuration > 0 && recordingDuration !== null) {
+ if (safeDuration > 0) {
if (!isWindows10) {
fixWebmDuration(
blob,
- recordingDuration,
+ safeDuration,
async (fixedWebm) => {
// Skip conversion only if Chrome is outdated or recording exceeds edit limit
if (
@@ -684,7 +756,6 @@ const ContentState = (props) => {
const fixedWebm = await fixWebmDurationFallback(blob, {
type: "video/webm; codecs=vp8, opus",
});
-
// Skip conversion only if Chrome is outdated or recording exceeds edit limit
if (
contentStateRef.current.updateChrome ||
@@ -714,7 +785,10 @@ const ContentState = (props) => {
reader.readAsDataURL(fixedWebm);
}
} else {
- /// Skip fixing duration
+ // Duration unknown — skip fixing, use raw blob as-is
+ console.warn(
+ "[Screenity][WebM] skipping duration fix: safeDuration=0, blob will have broken seek metadata",
+ );
// Skip conversion only if Chrome is outdated or recording exceeds edit limit
if (
contentStateRef.current.updateChrome ||
@@ -744,6 +818,10 @@ const ContentState = (props) => {
reader.readAsDataURL(blob);
}
} catch (error) {
+ console.error(
+ "[Screenity][WebM] duration fix failed, using unfixed blob:",
+ error,
+ );
setContentState((prevState) => ({
...prevState,
webm: blob,
@@ -770,6 +848,15 @@ const ContentState = (props) => {
() => {
chrome.runtime.sendMessage({ type: "memory-limit-help" });
},
+ false, // colorSafe
+ chrome.i18n.getMessage("getHelpButton"),
+ () => {
+ chrome.runtime.sendMessage({
+ type: "report-error",
+ errorCode: "REC_RUN_MEMORY",
+ source: "memory-limit",
+ });
+ },
);
}
});
@@ -790,7 +877,8 @@ const ContentState = (props) => {
try {
await Promise.all(
chunks.map(async (chunk) => {
- if (contentStateRef.current.chunkIndex >= chunkCount.current) {
+ // contentStateRef is sync — chunkCount.current lags a render cycle.
+ if (contentStateRef.current.chunkIndex >= contentStateRef.current.chunkCount) {
return; // Skip processing
}
@@ -855,27 +943,63 @@ const ContentState = (props) => {
checkMemory();
reconstructVideo();
- setTimeout(() => {
+ // Timeout: if duration-fix hasn't finished, mark ready so the user
+ // isn't stuck forever. Don't overwrite an already-fixed webm.
+ const safetyCheck = () => {
const s = contentStateRef.current;
if (DEBUG_POSTSTOP)
- console.debug("[Screenity][Sandbox] makeVideoTab: post-check", {
+ console.debug("[Screenity][Sandbox] makeVideoTab: safety-check", {
chunkCount: s?.chunkCount,
chunkIndex: s?.chunkIndex,
rawBlob: Boolean(s?.rawBlob),
+ webm: Boolean(s?.webm),
ready: s?.ready,
});
+ if (s?.ready) return; // Fix already completed, nothing to do
+
const complete = s?.chunkCount > 0 && s?.chunkIndex >= s?.chunkCount;
- if (complete && !s?.ready && s?.rawBlob) {
- setContentState((prev) => ({
- ...prev,
- webm: prev.webm || prev.rawBlob,
- ready: true,
- noffmpeg: true,
- isFfmpegRunning: false,
- }));
+ if (complete && s?.rawBlob) {
+ // Keep the fixed webm if it landed between checks.
+ if (s?.webm) {
+ if (DEBUG_RECORDER)
+ console.log(
+ "[Screenity][WebM] safety timeout: webm already set by fix, marking ready",
+ );
+ setContentState((prev) => ({
+ ...prev,
+ ready: true,
+ noffmpeg: true,
+ isFfmpegRunning: false,
+ }));
+ } else {
+ console.warn(
+ "[Screenity][WebM] safety timeout: duration fix did not complete in time, using unfixed rawBlob",
+ );
+ setContentState((prev) => ({
+ ...prev,
+ webm: prev.rawBlob,
+ ready: true,
+ noffmpeg: true,
+ isFfmpegRunning: false,
+ }));
+ }
chrome.runtime.sendMessage({ type: "recording-complete" });
}
+ };
+ // First check at 30s; if still not ready, final check at 60s
+ setTimeout(() => {
+ if (!contentStateRef.current?.ready) {
+ safetyCheck();
+ }
}, 30000);
+ setTimeout(() => {
+ if (!contentStateRef.current?.ready) {
+ console.warn(
+ "[Screenity][WebM] 60s safety timeout: force-marking ready",
+ );
+ safetyCheck();
+ }
+ }, 60000);
if (sendResponse) sendResponse({ status: "ok" });
};
@@ -1214,6 +1338,10 @@ const ContentState = (props) => {
const onMessage = async (event) => {
if (event.data.type === "updated-blob") {
+ // Discard results from a timed-out or superseded operation.
+ const msgOpId = event.data._opId;
+ if (msgOpId != null && msgOpId !== opIdRef.current) return;
+
const base64 = event.data.base64;
const blob = base64ToUint8Array(base64);
@@ -1223,32 +1351,44 @@ const ContentState = (props) => {
const isFromAudio = event.data.fromAudio === true;
if (isFromAudio) {
+ // Mid-chain: add-audio succeeded; reencode is still pending.
+ // Forward the same opId so the reencode result is also validated.
sendMessage({
type: "reencode-video",
blob,
duration: contentState.duration,
topLevel: isTopLevel,
+ _opId: event.data._opId,
});
return;
}
- setContentState((prev) => ({
- ...prev,
- blob: blob,
- mp4ready: true,
- hasBeenEdited: event.data.edited === false ? prev.hasBeenEdited : true,
- isFfmpegRunning: false,
- reencoding: false,
- trimming: false,
- cutting: false,
- muting: false,
- cropping: false,
- processingProgress: 0,
- hasTempChanges: !isTopLevel,
+ clearEditOp();
- ...(prev.fromCropper && { mode: "player", fromCropper: false }),
- ...(prev.fromAudio && { mode: "player", fromAudio: false }),
- }));
+ setContentState((prev) => {
+ const wasFirstReady = !prev.mp4ready && isTopLevel;
+ if (wasFirstReady) {
+ chrome.runtime.sendMessage({ type: "diag-editor-ready", path: "updated-blob" }).catch(() => {});
+ }
+ return {
+ ...prev,
+ blob: blob,
+ mp4ready: true,
+ hasBeenEdited: event.data.edited === false ? prev.hasBeenEdited : true,
+ isFfmpegRunning: false,
+ reencoding: false,
+ trimming: false,
+ cutting: false,
+ muting: false,
+ cropping: false,
+ processingProgress: 0,
+ editErrorType: null,
+ hasTempChanges: !isTopLevel,
+
+ ...(prev.fromCropper && { mode: "player", fromCropper: false }),
+ ...(prev.fromAudio && { mode: "player", fromAudio: false }),
+ };
+ });
const video = document.createElement("video");
video.preload = "metadata";
@@ -1347,20 +1487,45 @@ const ContentState = (props) => {
// }
} else if (event.data.type === "ffmpeg-error") {
console.warn("FFmpeg error:", event.data.error);
+ clearEditOp();
// Fallback: allow playback/download using webm/rawBlob even if conversion fails
+ setContentState((prev) => {
+ // If an edit was actively running, surface the failure to the user
+ const wasEditing = prev.isFfmpegRunning && (prev.cutting || prev.trimming || prev.muting || prev.cropping || prev.reencoding);
+ return {
+ ...prev,
+ noffmpeg: true,
+ ffmpegLoaded: true, // treat as "done trying"
+ isFfmpegRunning: false,
+ muting: false,
+ cutting: false,
+ trimming: false,
+ reencoding: false,
+ cropping: false,
+ processingProgress: 0,
+ editErrorType: wasEditing ? "failed" : prev.editErrorType,
+ ...(prev.rawBlob || prev.webm
+ ? { ready: true, webm: prev.webm || prev.rawBlob }
+ : {}),
+ };
+ });
+
+ chrome.runtime.sendMessage({ type: "recording-complete" });
+ } else if (event.data.type === "edit-too-long") {
+ // Too long for in-browser processing — reset so user can retry or trim.
+ clearEditOp();
setContentState((prev) => ({
...prev,
- noffmpeg: true,
- ffmpegLoaded: true, // treat as “done trying”
isFfmpegRunning: false,
+ muting: false,
+ cutting: false,
+ trimming: false,
+ reencoding: false,
+ cropping: false,
processingProgress: 0,
- ...(prev.rawBlob || prev.webm
- ? { ready: true, webm: prev.webm || prev.rawBlob }
- : {}),
+ editErrorType: "too-long",
}));
-
- chrome.runtime.sendMessage({ type: "recording-complete" });
} else if (event.data.type === "crop-update") {
setContentState((prevContentState) => ({
...prevContentState,
@@ -1464,6 +1629,34 @@ const ContentState = (props) => {
getBlob();
}, [contentState.base64, contentState.ffmpeg, contentState.ffmpegLoaded]);
+ // 30s fallback: if FFmpeg never loads (blocked CDN, worker crash, etc.),
+ // force recovery mode so the user can still download their recording.
+ useEffect(() => {
+ if (!contentState.base64) return;
+ if (!contentState.ffmpeg) return;
+ if (contentState.ffmpegLoaded) return; // FFmpeg loaded normally — nothing to do
+ if (contentState.noffmpeg) return; // already in fallback — nothing to do
+
+ const timer = setTimeout(() => {
+ // Re-check via ref in case state changed since the effect ran.
+ const current = contentStateRef.current;
+ if (current.ffmpegLoaded || current.noffmpeg) return;
+ chrome.storage.local.set({ editorLoadTimeoutAt: Date.now() });
+ setContentState((prev) => {
+ // Double-check inside the updater for concurrent state races.
+ if (prev.ffmpegLoaded || prev.noffmpeg) return prev;
+ return {
+ ...prev,
+ noffmpeg: true,
+ ffmpegLoaded: true,
+ fallback: true,
+ };
+ });
+ }, 30000);
+
+ return () => clearTimeout(timer);
+ }, [contentState.base64, contentState.ffmpeg, contentState.ffmpegLoaded, contentState.noffmpeg]);
+
const getImage = useCallback(async () => {
if (!contentState.blob) return;
if (!contentState.ffmpeg) return;
@@ -1477,6 +1670,39 @@ const ContentState = (props) => {
sendMessage({ type: "get-frame", time: 0, blob: contentState.blob });
}, [contentState.blob, contentState.ffmpeg, contentState.isFfmpegRunning]);
+ // Returns the opId to include in outgoing messages for stale-result validation.
+ const beginEditOp = () => {
+ if (editWatchdogRef.current) {
+ clearTimeout(editWatchdogRef.current);
+ }
+ opIdRef.current += 1;
+ const id = opIdRef.current;
+ editWatchdogRef.current = setTimeout(() => {
+ editWatchdogRef.current = null;
+ opIdRef.current += 1; // invalidate any late-arriving result
+ setContentState((prev) => ({
+ ...prev,
+ isFfmpegRunning: false,
+ muting: false,
+ cutting: false,
+ trimming: false,
+ reencoding: false,
+ cropping: false,
+ processingProgress: 0,
+ editErrorType: "timeout",
+ }));
+ }, 5 * 60 * 1000); // 5-minute ceiling
+ return id;
+ };
+
+ // Clears the watchdog when an op completes or fails normally.
+ const clearEditOp = () => {
+ if (editWatchdogRef.current) {
+ clearTimeout(editWatchdogRef.current);
+ editWatchdogRef.current = null;
+ }
+ };
+
const addAudio = async (videoBlob, audioBlob, volume) => {
if (contentState.isFfmpegRunning) return;
if (
@@ -1486,11 +1712,13 @@ const ContentState = (props) => {
return;
const sourceBlob = videoBlob || contentState.blob || contentState.webm;
+ const opId = beginEditOp();
setContentState((prev) => ({
...prev,
isFfmpegRunning: true,
processingProgress: 0,
+ editErrorType: null,
}));
sendMessage({
@@ -1501,6 +1729,7 @@ const ContentState = (props) => {
volume: volume,
replaceAudio: contentState.replaceAudio,
topLevel: false,
+ _opId: opId,
});
};
@@ -1513,11 +1742,13 @@ const ContentState = (props) => {
return;
const sourceBlob = contentState.blob;
+ const opId = beginEditOp();
setContentState((prev) => ({
...prev,
isFfmpegRunning: true,
processingProgress: 0,
+ editErrorType: null,
[cut ? "cutting" : "trimming"]: true,
}));
@@ -1530,6 +1761,7 @@ const ContentState = (props) => {
duration: contentState.duration,
encode: false,
topLevel: false,
+ _opId: opId,
});
};
@@ -1542,12 +1774,14 @@ const ContentState = (props) => {
return;
const sourceBlob = contentState.blob;
+ const opId = beginEditOp();
setContentState((prev) => ({
...prev,
muting: true,
isFfmpegRunning: true,
processingProgress: 0,
+ editErrorType: null,
}));
sendMessage({
@@ -1557,6 +1791,7 @@ const ContentState = (props) => {
endTime: contentState.end * contentState.duration,
duration: contentState.duration,
topLevel: false,
+ _opId: opId,
});
};
@@ -1568,11 +1803,14 @@ const ContentState = (props) => {
)
return;
+ const opId = beginEditOp();
+
setContentState((prevState) => ({
...prevState,
cropping: true,
isFfmpegRunning: true,
processingProgress: 0,
+ editErrorType: null,
}));
const sourceBlob = contentState.blob;
@@ -1585,6 +1823,7 @@ const ContentState = (props) => {
width,
height,
topLevel: false,
+ _opId: opId,
});
return true;
@@ -1594,12 +1833,14 @@ const ContentState = (props) => {
if (contentState.isFfmpegRunning) return;
const sourceBlob = contentState.blob;
+ const opId = beginEditOp();
setContentState((prevState) => ({
...prevState,
isFfmpegRunning: true,
reencoding: true,
- processingProgress: 0, // Reset progress
+ processingProgress: 0,
+ editErrorType: null,
}));
sendMessage({
@@ -1607,6 +1848,7 @@ const ContentState = (props) => {
blob: sourceBlob,
duration: contentState.duration,
topLevel,
+ _opId: opId,
});
return true;
@@ -1852,6 +2094,12 @@ const ContentState = (props) => {
return (
<ContentStateContext.Provider value={[contentState, setContentState]}>
{props.children}
+ {process.env.SCREENITY_DEV_MODE === "true" && (
+ <DevHUD
+ setContentState={setContentState}
+ contentStateRef={contentStateRef}
+ />
+ )}
</ContentStateContext.Provider>
);
};
diff --git a/src/pages/Sandbox/layout/player/RightPanel.js b/src/pages/Sandbox/layout/player/RightPanel.js
index 5aa2be5..debe449 100644
--- a/src/pages/Sandbox/layout/player/RightPanel.js
+++ b/src/pages/Sandbox/layout/player/RightPanel.js
@@ -30,6 +30,17 @@ const RightPanel = () => {
contentStateRef.current = contentState;
}, [contentState]);
+ // Returns a context-specific "not available" label for disabled buttons
+ const getNotAvailableLabel = () => {
+ if (contentState.fallback && contentState.noffmpeg && contentState.editLimit === 0) {
+ return chrome.i18n.getMessage("notAvailableLongRecording");
+ }
+ if (contentState.fallback && contentState.noffmpeg) {
+ return chrome.i18n.getMessage("notAvailableRecoveryMode");
+ }
+ return chrome.i18n.getMessage("notAvailableLabel");
+ };
+
const getPreparingLabel = () => {
const base = chrome.i18n.getMessage("preparingLabel");
const pct = Math.round(contentState.processingProgress || 0);
@@ -40,27 +51,67 @@ const RightPanel = () => {
};
const saveToDrive = () => {
- //if (contentState.noffmpeg) return;
setContentState((prevContentState) => ({
...prevContentState,
saveDrive: true,
}));
+ const handleDriveResponse = (response) => {
+ if (!response || response.status === "ew" || response.error) {
+ console.error("[Drive] drive_save_failed:", response?.error || "unknown error");
+ setContentState((prevContentState) => ({
+ ...prevContentState,
+ saveDrive: false,
+ }));
+ }
+ // On success, saveDrive is reset by the "saved-to-drive" message from background
+ };
+
+ const handleDriveError = (err) => {
+ console.error("[Drive] drive_save_error:", err);
+ setContentState((prevContentState) => ({
+ ...prevContentState,
+ saveDrive: false,
+ }));
+ };
+
if (contentState.noffmpeg || !contentState.mp4ready || !contentState.blob) {
- chrome.runtime
- .sendMessage({
- type: "save-to-drive-fallback",
- title: contentState.title,
- })
- .then((response) => {
- if (response.status === "ew") {
- // Cancel saving to drive
- setContentState((prevContentState) => ({
- ...prevContentState,
- saveDrive: false,
- }));
- }
- });
+ // Prefer the duration-fixed webm blob over rebuilding from raw chunks
+ const fixedWebm = contentState.webm;
+ if (fixedWebm && fixedWebm instanceof Blob && fixedWebm.size > 0) {
+ const reader = new FileReader();
+ reader.onload = () => {
+ const dataUrl = reader.result;
+ const base64 = dataUrl.split(",")[1];
+ chrome.runtime
+ .sendMessage({
+ type: "save-to-drive",
+ base64: base64,
+ title: contentState.title,
+ isWebm: true,
+ })
+ .then(handleDriveResponse)
+ .catch(handleDriveError);
+ };
+ reader.onerror = () => {
+ chrome.runtime
+ .sendMessage({
+ type: "save-to-drive-fallback",
+ title: contentState.title,
+ })
+ .then(handleDriveResponse)
+ .catch(handleDriveError);
+ };
+ reader.readAsDataURL(fixedWebm);
+ } else {
+ chrome.runtime
+ .sendMessage({
+ type: "save-to-drive-fallback",
+ title: contentState.title,
+ })
+ .then(handleDriveResponse)
+ .catch(handleDriveError);
+ }
} else {
// Blob to base64
const reader = new FileReader();
@@ -74,15 +125,15 @@ const RightPanel = () => {
base64: base64,
title: contentState.title,
})
- .then((response) => {
- if (response.status === "ew") {
- // Cancel saving to drive
- setContentState((prevContentState) => ({
- ...prevContentState,
- saveDrive: false,
- }));
- }
- });
+ .then(handleDriveResponse)
+ .catch(handleDriveError);
+ };
+ reader.onerror = () => {
+ console.error("[Drive] FileReader failed to read blob for Drive upload");
+ setContentState((prevContentState) => ({
+ ...prevContentState,
+ saveDrive: false,
+ }));
};
if (
!contentState.noffmpeg &&
@@ -179,6 +230,23 @@ const RightPanel = () => {
}
};
+ // Download best available blob: edited MP4 → fixed WebM → raw WebM.
+ const handleDownloadOriginal = () => {
+ const s = contentStateRef.current;
+ const source = s.blob || s.webm || s.rawBlob;
+ if (!source) return;
+ const blob =
+ source instanceof Blob
+ ? source
+ : new Blob([source], { type: "video/webm" });
+ const ext = blob.type.includes("mp4") ? "mp4" : "webm";
+ const title = s.title || "screenity-recording";
+ const url = window.URL.createObjectURL(blob);
+ chrome.downloads.download({ url, filename: `${title}.${ext}` }, () => {
+ window.URL.revokeObjectURL(url);
+ });
+ };
+
const handleRawRecording = () => {
if (typeof contentStateRef.current.openModal === "function") {
contentStateRef.current.openModal(
@@ -187,7 +255,12 @@ const RightPanel = () => {
chrome.i18n.getMessage("rawRecordingModalButton"),
chrome.i18n.getMessage("sandboxEditorCancelButton"),
() => {
- const blob = contentStateRef.current.rawBlob;
+ const s = contentStateRef.current;
+ const blob = s.rawBlob;
+ if (!blob) {
+ console.error("[Screenity][WebM] raw download: no rawBlob available");
+ return;
+ }
const url = window.URL.createObjectURL(blob);
const ext = blob.type.includes("mp4") ? "mp4" : "webm";
@@ -275,7 +348,28 @@ const RightPanel = () => {
</div>
</div>
)}
- {contentState.fallback && contentState.noffmpeg && (
+ {contentState.fallback && contentState.noffmpeg && contentState.editLimit === 0 && (
+ <div className={styles.alert}>
+ <div className={styles.buttonLeft}>
+ <ReactSVG src={URL + "editor/icons/alert.svg"} />
+ </div>
+ <div className={styles.buttonMiddle}>
+ <div className={styles.buttonTitle}>
+ {chrome.i18n.getMessage("longRecordingTitle")}
+ </div>
+ <div className={styles.buttonDescription}>
+ {chrome.i18n.getMessage("longRecordingDescription")}
+ </div>
+ </div>
+ <div
+ className={styles.buttonRight}
+ onClick={handleDownloadOriginal}
+ >
+ {chrome.i18n.getMessage("rawRecordingModalButton")}
+ </div>
+ </div>
+ )}
+ {contentState.fallback && contentState.noffmpeg && contentState.editLimit !== 0 && (
<div className={styles.alert}>
<div className={styles.buttonLeft}>
<ReactSVG src={URL + "editor/icons/alert.svg"} />
@@ -285,9 +379,15 @@ const RightPanel = () => {
{chrome.i18n.getMessage("recoveryModeTitle")}
</div>
<div className={styles.buttonDescription}>
- {chrome.i18n.getMessage("overLimitLabelDescription")}
+ {chrome.i18n.getMessage("recoveryModeDescription")}
</div>
</div>
+ <div
+ className={styles.buttonRight}
+ onClick={handleDownloadOriginal}
+ >
+ {chrome.i18n.getMessage("rawRecordingModalButton")}
+ </div>
</div>
)}
{!contentState.fallback &&
@@ -381,9 +481,12 @@ const RightPanel = () => {
{chrome.i18n.getMessage("videoProcessingLabelTitle")}
</div>
<div className={styles.buttonDescription}>
- {chrome.i18n.getMessage("videoProcessingLabelDescription")}
+ {contentState.isFfmpegRunning
+ ? chrome.i18n.getMessage("editProcessingSafeDescription")
+ : chrome.i18n.getMessage("videoProcessingLabelDescription")}
</div>
</div>
+ {!contentState.isFfmpegRunning && (
<div
className={styles.buttonRight}
onClick={() => {
@@ -394,9 +497,79 @@ const RightPanel = () => {
>
{chrome.i18n.getMessage("learnMoreLabel")}
</div>
+ )}
</div>
)}
+ {!contentState.fallback && contentState.editErrorType === "too-long" && (
+ <div className={styles.alert}>
+ <div className={styles.buttonLeft}>
+ <ReactSVG src={URL + "editor/icons/alert.svg"} />
+ </div>
+ <div className={styles.buttonMiddle}>
+ <div className={styles.buttonTitle}>
+ {chrome.i18n.getMessage("editTooLongTitle")}
+ </div>
+ <div className={styles.buttonDescription}>
+ {chrome.i18n.getMessage("editTooLongDescription")}
+ </div>
+ </div>
+ <div
+ className={styles.buttonRight}
+ onClick={() =>
+ setContentState((prev) => ({ ...prev, editErrorType: null }))
+ }
+ >
+ {chrome.i18n.getMessage("permissionsModalDismiss")}
+ </div>
+ </div>
+ )}
+ {!contentState.fallback && contentState.editErrorType === "timeout" && (
+ <div className={styles.alert}>
+ <div className={styles.buttonLeft}>
+ <ReactSVG src={URL + "editor/icons/alert.svg"} />
+ </div>
+ <div className={styles.buttonMiddle}>
+ <div className={styles.buttonTitle}>
+ {chrome.i18n.getMessage("editTimeoutTitle")}
+ </div>
+ <div className={styles.buttonDescription}>
+ {chrome.i18n.getMessage("editTimeoutDescription")}
+ </div>
+ </div>
+ <div
+ className={styles.buttonRight}
+ onClick={() =>
+ setContentState((prev) => ({ ...prev, editErrorType: null }))
+ }
+ >
+ {chrome.i18n.getMessage("permissionsModalDismiss")}
+ </div>
+ </div>
+ )}
+ {!contentState.fallback && contentState.editErrorType === "failed" && (
+ <div className={styles.alert}>
+ <div className={styles.buttonLeft}>
+ <ReactSVG src={URL + "editor/icons/alert.svg"} />
+ </div>
+ <div className={styles.buttonMiddle}>
+ <div className={styles.buttonTitle}>
+ {chrome.i18n.getMessage("editFailedTitle")}
+ </div>
+ <div className={styles.buttonDescription}>
+ {chrome.i18n.getMessage("editFailedDescription")}
+ </div>
+ </div>
+ <div
+ className={styles.buttonRight}
+ onClick={() =>
+ setContentState((prev) => ({ ...prev, editErrorType: null }))
+ }
+ >
+ {chrome.i18n.getMessage("permissionsModalDismiss")}
+ </div>
+ </div>
+ )}
<div className={styles.section}>
<div className={styles.sectionTitle}>
{chrome.i18n.getMessage("sandboxEditTitle")}
@@ -427,7 +600,7 @@ const RightPanel = () => {
contentState.noffmpeg ||
(contentState.duration > contentState.editLimit &&
!contentState.override)
- ? chrome.i18n.getMessage("notAvailableLabel")
+ ? getNotAvailableLabel()
: contentState.mp4ready
? chrome.i18n.getMessage("editButtonDescription")
: getPreparingLabel()}
@@ -462,7 +635,7 @@ const RightPanel = () => {
contentState.noffmpeg ||
(contentState.duration > contentState.editLimit &&
!contentState.override)
- ? chrome.i18n.getMessage("notAvailableLabel")
+ ? getNotAvailableLabel()
: contentState.mp4ready
? chrome.i18n.getMessage("cropButtonDescription")
: getPreparingLabel()}
@@ -497,7 +670,7 @@ const RightPanel = () => {
contentState.noffmpeg ||
(contentState.duration > contentState.editLimit &&
!contentState.override)
- ? chrome.i18n.getMessage("notAvailableLabel")
+ ? getNotAvailableLabel()
: contentState.mp4ready
? chrome.i18n.getMessage("addAudioButtonDescription")
: getPreparingLabel()}
@@ -615,7 +788,7 @@ const RightPanel = () => {
contentState.noffmpeg ||
(contentState.duration > contentState.editLimit &&
!contentState.override)
- ? chrome.i18n.getMessage("notAvailableLabel")
+ ? getNotAvailableLabel()
: contentState.mp4ready && !contentState.isFfmpegRunning
? chrome.i18n.getMessage("downloadMP4ButtonDescription")
: getPreparingLabel()}
@@ -684,7 +857,7 @@ const RightPanel = () => {
contentState.noffmpeg ||
(contentState.duration > contentState.editLimit &&
!contentState.override)
- ? chrome.i18n.getMessage("notAvailableLabel")
+ ? getNotAvailableLabel()
: contentState.mp4ready
? chrome.i18n.getMessage("downloadGIFButtonDescription")
: getPreparingLabel()}
diff --git a/src/pages/Sandbox/styles/player/_RightPanel.module.scss b/src/pages/Sandbox/styles/player/_RightPanel.module.scss
index b7ae830..37f3272 100644
--- a/src/pages/Sandbox/styles/player/_RightPanel.module.scss
+++ b/src/pages/Sandbox/styles/player/_RightPanel.module.scss
@@ -53,12 +53,13 @@
.alert {
display: flex;
width: 100%;
- height: 80px;
+ min-height: 80px;
+ padding: 12px 0;
justify-content: space-between;
align-items: center;
position: relative;
- overflow: hidden;
background-color: rgba(56, 126, 247, 0.1);
+ box-sizing: border-box;
.buttonRight {
color: $color-primary;
diff --git a/src/pages/utils/buildDiagnosticZip.js b/src/pages/utils/buildDiagnosticZip.js
index eed9a8f..018987b 100644
--- a/src/pages/utils/buildDiagnosticZip.js
+++ b/src/pages/utils/buildDiagnosticZip.js
@@ -1,14 +1,6 @@
/**
- * Shared helper that builds the diagnostic ZIP blob used by both:
- * - popup Settings Menu ("Download data for troubleshooting")
- * - Sandbox/Editor RightPanel ("Get help with your recording")
- *
- * Returns { blob, filename } so the caller can decide how to trigger the download
- * (content script uses <a>.click(), sandbox uses chrome.downloads.download).
- *
- * @param {Object} [options]
- * @param {Object} [options.extraConfig] — caller-specific config fields merged into config.json
- * @param {string} [options.source] — label for which entry point triggered the export
+ * Builds a diagnostic ZIP for troubleshooting. Returns { blob, filename }.
+ * Used by the popup settings menu and the editor "Get help" button.
*/
import JSZip from "jszip";
@@ -82,9 +74,26 @@ export const buildDiagnosticZip = async ({
}),
);
- // sessions.json — diagnostic session timeline
+ // sessions.json — diagnostic session timeline with derived hints
if (diagData?.log) {
- zip.file("sessions.json", JSON.stringify(diagData.log));
+ const annotated = JSON.parse(JSON.stringify(diagData.log));
+ if (annotated.sessions) {
+ for (const session of annotated.sessions) {
+ if (!session.events?.length) continue;
+ const hints = [];
+ const hasEditorOpen = session.events.some(
+ (ev) => ev.e === "editor-open" && ev.d?.type === "editorwebcodecs",
+ );
+ const hasEditorReady = session.events.some(
+ (ev) => ev.e === "editor-load-ready",
+ );
+ if (hasEditorOpen && !hasEditorReady) {
+ hints.push("Editor handoff incomplete: editor opened but never finished loading");
+ }
+ if (hints.length > 0) session.hints = hints;
+ }
+ }
+ zip.file("sessions.json", JSON.stringify(annotated));
}
// errors.json — consolidated error-state keys
diff --git a/src/pages/utils/buildSupportContext.js b/src/pages/utils/buildSupportContext.js
index 76d93fb..b47e7d3 100644
--- a/src/pages/utils/buildSupportContext.js
+++ b/src/pages/utils/buildSupportContext.js
@@ -1,18 +1,10 @@
/**
- * Builds a flat, URL-safe support-context object for Tally form prefills.
- *
- * Privacy rules:
- * - No full URLs, user IDs, auth tokens, or page content
- * - Error messages are stripped of URL-like substrings and truncated
- * - No raw diagnostic logs, video blobs, or storage dumps
- * - User name/email only included when caller explicitly passes them
- *
- * All values are short strings safe for URLSearchParams.
+ * Builds a URL-safe support-context object for Tally form prefills.
+ * No URLs, tokens, page content, or blobs — only sanitized technical metadata.
*/
const MAX_ERR_LEN = 120;
-/** Strip anything that looks like a URL from an error string. */
const sanitizeError = (err) => {
if (!err) return "";
const str = typeof err === "string" ? err : String(err);
@@ -22,7 +14,6 @@ const sanitizeError = (err) => {
.slice(0, MAX_ERR_LEN);
};
-/** Extract "Chrome/124" or "Edg/124" from the user-agent string. */
const shortBrowser = () => {
const ua = navigator.userAgent || "";
const edg = ua.match(/Edg\/(\d+)/);
@@ -32,15 +23,7 @@ const shortBrowser = () => {
return "Unknown";
};
-/**
- * Build support context.
- *
- * @param {Object} [opts]
- * @param {boolean} [opts.includeRecordingState] — pull last-recording fields from storage
- * @param {string} [opts.source] — where the form was opened (e.g. "popup", "settings", "editor")
- * @param {{name:string, email:string}} [opts.user] — only pass when the user is already authenticated
- * @returns {Promise<Record<string, string>>} flat key-value pairs for URLSearchParams
- */
+/** Build support context. Returns flat key-value pairs for URLSearchParams. */
export const buildSupportContext = async (opts = {}) => {
const ctx = {};
@@ -56,6 +39,10 @@ export const buildSupportContext = async (opts = {}) => {
ctx.os = "unknown";
}
+ // Human-readable platform for Tally choice prefill
+ const platformMap = { mac: "macOS", win: "Windows", linux: "Linux", cros: "ChromeOS" };
+ ctx.platform = platformMap[ctx.os] || "Other";
+
ctx.cloud =
process.env.SCREENITY_ENABLE_CLOUD_FEATURES === "true" ? "1" : "0";
@@ -73,6 +60,7 @@ export const buildSupportContext = async (opts = {}) => {
"fastRecorderDisabledReason",
"isSubscribed",
"diagnosticLog",
+ "recordingAttemptId",
];
const store = await chrome.storage.local.get(keys);
@@ -81,10 +69,19 @@ export const buildSupportContext = async (opts = {}) => {
ctx.fast = store.fastRecorderInUse ? "1" : "0";
if (store.fastRecorderDisabledReason)
ctx.fastOff = String(store.fastRecorderDisabledReason).slice(0, 60);
- if (store.isSubscribed != null)
+ if (store.isSubscribed != null) {
ctx.sub = store.isSubscribed ? "1" : "0";
- if (store.lastRecordingError)
+ // Override the build-time cloud flag with actual subscription state
+ // so the support URL reflects whether this attempt used cloud or local.
+ ctx.cloud = store.isSubscribed ? "1" : "0";
+ }
+ if (store.lastRecordingError) {
ctx.lastErr = sanitizeError(store.lastRecordingError);
+ if (store.lastRecordingError.errorCode)
+ ctx.errCode = store.lastRecordingError.errorCode;
+ }
+ if (store.recordingAttemptId)
+ ctx.attemptId = store.recordingAttemptId;
// Last diagnostic session outcome (compact — just the outcome string)
if (store.diagnosticLog?.sessions?.length) {
@@ -93,12 +90,33 @@ export const buildSupportContext = async (opts = {}) => {
store.diagnosticLog.sessions.length - 1
];
if (last?.outcome) ctx.lastOutcome = last.outcome;
+ // Detect incomplete editor handoff (editor opened but never loaded)
+ if (last?.events?.length) {
+ const hasEditorOpen = last.events.some(
+ (ev) => ev.e === "editor-open" && ev.d?.type === "editorwebcodecs",
+ );
+ const hasEditorReady = last.events.some(
+ (ev) => ev.e === "editor-load-ready",
+ );
+ if (hasEditorOpen && !hasEditorReady) ctx.editorHandoff = "incomplete";
+ }
}
} catch {
// storage read failed — continue without recording state
}
}
+ // ---- explicit error overrides (from error modal "Get help" button) ----
+ if (opts.errorCode) ctx.errCode = opts.errorCode;
+ if (opts.errorWhy) ctx.lastErr = sanitizeError(opts.errorWhy);
+
+ // ---- support code (short human-readable reference) ----
+ if (ctx.attemptId) {
+ const hash = ctx.attemptId.replace(/[^a-z0-9]/gi, "").slice(-4).toUpperCase();
+ const date = new Date().toISOString().slice(0, 10).replace(/-/g, "");
+ ctx.supportCode = `SCR-${hash}-${date}`;
+ }
+
// ---- user info (only when explicitly provided) ----
if (opts.user) {
if (opts.user.name) ctx.name = opts.user.name;
@@ -108,10 +126,7 @@ export const buildSupportContext = async (opts = {}) => {
return ctx;
};
-/**
- * Convenience: build context and return it as a query string.
- * Drops any key whose value is empty/undefined.
- */
+/** Build context and return as a query string. */
export const supportContextQuery = async (opts = {}) => {
const ctx = await buildSupportContext(opts);
const params = new URLSearchParams();
diff --git a/src/pages/utils/buildSupportDebugInfo.js b/src/pages/utils/buildSupportDebugInfo.js
new file mode 100644
index 0000000..2d774ce
--- /dev/null
+++ b/src/pages/utils/buildSupportDebugInfo.js
@@ -0,0 +1,132 @@
+/**
+ * Clipboard-friendly debug summary for support.
+ * Same privacy rules as buildSupportContext — no URLs, tokens, or user content.
+ */
+
+import { makeSupportCode } from "./errorCodes";
+
+const MAX_ERR_LEN = 120;
+
+const sanitizeError = (err) => {
+ if (!err) return "";
+ const str = typeof err === "string" ? err : String(err);
+ return str
+ .replace(/https?:\/\/[^\s)]+/gi, "[url]")
+ .replace(/chrome-extension:\/\/[^\s)]+/gi, "[ext]")
+ .slice(0, MAX_ERR_LEN);
+};
+
+const shortBrowser = () => {
+ const ua = navigator.userAgent || "";
+ const edg = ua.match(/Edg\/(\d+)/);
+ if (edg) return `Edge/${edg[1]}`;
+ const ch = ua.match(/Chrome\/(\d+)/);
+ if (ch) return `Chrome/${ch[1]}`;
+ return "Unknown";
+};
+
+const shortOS = async () => {
+ try {
+ const info = await chrome.runtime.getPlatformInfo();
+ return info.os || "unknown";
+ } catch {
+ return "unknown";
+ }
+};
+
+/** Build a plain-text debug info block for clipboard. */
+export const buildSupportDebugInfo = async (opts = {}) => {
+ const version = chrome.runtime.getManifest().version;
+ const browser = shortBrowser();
+ const os = await shortOS();
+ const ts = new Date().toISOString();
+
+ // Pull relevant state from storage
+ let store = {};
+ try {
+ store = await chrome.storage.local.get([
+ "recordingAttemptId",
+ "recordingType",
+ "fastRecorderInUse",
+ "fastRecorderDisabledReason",
+ "isSubscribed",
+ "lastRecordingError",
+ "lastStreamCheckFail",
+ "lastAutoDiscardableError",
+ "streamLifecycleLog",
+ "diagnosticLog",
+ ]);
+ } catch {
+ // storage read failed — continue with defaults
+ }
+
+ const attemptId = store.recordingAttemptId || null;
+ const supportCode = makeSupportCode(attemptId);
+
+ // Determine error code: prefer explicit, fall back to stored
+ const errorCode =
+ opts.errorCode ||
+ store.lastRecordingError?.errorCode ||
+ null;
+
+ const errorWhy = sanitizeError(
+ opts.errorWhy || store.lastRecordingError?.why || ""
+ );
+
+ // Recording mode
+ const recType = store.recordingType || "unknown";
+ const fastRec = store.fastRecorderInUse ? "active" : "off";
+ const fastOff = store.fastRecorderDisabledReason || null;
+ const sub = store.isSubscribed ? "pro" : "free";
+
+ // Last diagnostic session outcome + editor handoff check
+ let lastOutcome = null;
+ let editorHandoffIncomplete = false;
+ if (store.diagnosticLog?.sessions?.length) {
+ const last =
+ store.diagnosticLog.sessions[store.diagnosticLog.sessions.length - 1];
+ lastOutcome = last?.outcome || null;
+ if (last?.events?.length) {
+ const hasEditorOpen = last.events.some(
+ (ev) => ev.e === "editor-open" && ev.d?.type === "editorwebcodecs",
+ );
+ const hasEditorReady = last.events.some(
+ (ev) => ev.e === "editor-load-ready",
+ );
+ editorHandoffIncomplete = hasEditorOpen && !hasEditorReady;
+ }
+ }
+
+ // Build the text block
+ const lines = [
+ `Screenity Debug Info`,
+ `====================`,
+ `Code: ${supportCode}`,
+ ];
+ if (errorCode) lines.push(`Error: ${errorCode}`);
+ if (errorWhy) lines.push(`Detail: ${errorWhy}`);
+ lines.push(`Version: ${version}`);
+ lines.push(`Browser: ${browser}`);
+ lines.push(`OS: ${os}`);
+ lines.push(`Mode: ${recType}`);
+ lines.push(`Fast MP4: ${fastRec}${fastOff ? ` (${fastOff})` : ""}`);
+ lines.push(`Plan: ${sub}`);
+ if (lastOutcome) lines.push(`Session: ${lastOutcome}`);
+ if (editorHandoffIncomplete) lines.push(`EditorLoad: incomplete (editor opened but never became ready)`);
+ if (store.lastStreamCheckFail) {
+ const sc = store.lastStreamCheckFail;
+ lines.push(`StreamChk: ${sc.bucket || "?"} vis=${sc.docVisibility || sc.docHidden} ms=${sc.msSinceReady ?? "?"}`);
+ }
+ if (store.lastAutoDiscardableError) {
+ lines.push(`AutoDisc: failed tab=${store.lastAutoDiscardableError.tabId}`);
+ }
+ if (store.streamLifecycleLog?.length) {
+ const sl = store.streamLifecycleLog;
+ const tags = sl.map((e) => `${e.tag}@${e.t}`).join(" → ");
+ lines.push(`SL(${sl.length}): ${tags.slice(0, 300)}`);
+ }
+ if (attemptId) lines.push(`Ref: ${attemptId}`);
+ lines.push(`Time: ${ts}`);
+
+ return lines.join("\n");
+};
diff --git a/src/pages/utils/diagnosticLog.js b/src/pages/utils/diagnosticLog.js
index d11b856..55294f9 100644
--- a/src/pages/utils/diagnosticLog.js
+++ b/src/pages/utils/diagnosticLog.js
@@ -1,14 +1,6 @@
/**
- * Always-on diagnostic log for free/local recording sessions.
- *
- * Stores a compact ring buffer of session events in chrome.storage.local
- * under the key "diagnosticLog". Max 5 sessions, 100 events each (~100 KB).
- *
- * Usage (background service worker):
- * import { initDiagSession, diagEvent, endDiagSession } from '../utils/diagnosticLog';
- * await initDiagSession({ recordingType: 'screen', quality: '1080p', ... });
- * diagEvent('chunk', { idx: 10, bytes: 45000 });
- * await endDiagSession('ok');
+ * Ring-buffer diagnostic log stored in chrome.storage.local ("diagnosticLog").
+ * Max 5 sessions, 100 events each. Used in the background service worker.
*/
const MAX_SESSIONS = 5;
@@ -18,10 +10,6 @@ const FLUSH_EVERY_N = 10; // flush to storage every N events
let _log = null; // in-memory mirror of diagnosticLog
let _dirty = 0; // events written since last flush
-// ---------------------------------------------------------------------------
-// Internal helpers
-// ---------------------------------------------------------------------------
-
const now = () => Date.now();
const makeId = () =>
@@ -50,13 +38,7 @@ const maybeFlush = () => {
}
};
-// ---------------------------------------------------------------------------
-// Public API
-// ---------------------------------------------------------------------------
-
-/**
- * Hydrate the in-memory log from storage. Call once on service-worker init.
- */
+/** Hydrate the in-memory log from storage. Call once on SW init. */
export const hydrateDiagnosticLog = async () => {
try {
const res = await chrome.storage.local.get("diagnosticLog");
@@ -66,10 +48,7 @@ export const hydrateDiagnosticLog = async () => {
}
};
-/**
- * Begin a new diagnostic session. Call from startRecording().
- * @param {Object} config — snapshot of recording settings
- */
+/** Start a new session. Call from startRecording(). */
export const initDiagSession = async (config = {}) => {
if (!_log) await hydrateDiagnosticLog();
@@ -93,11 +72,7 @@ export const initDiagSession = async (config = {}) => {
return session.id;
};
-/**
- * Append an event to the current (open) session.
- * @param {string} eventType — short event name, e.g. "stop", "error"
- * @param {Object} [data] — small payload (keep lightweight)
- */
+/** Append an event to the current open session. */
export const diagEvent = (eventType, data) => {
const s = currentSession();
if (!s) return; // no open session
@@ -117,11 +92,7 @@ export const diagEvent = (eventType, data) => {
s.events.shift();
}
- // Immediate flush for errors, crashes, and all session lifecycle events.
- // A normal recording only produces ~6-8 events, which is well under the
- // FLUSH_EVERY_N threshold of 10. If the SW is killed before reaching
- // that threshold, all buffered events are lost. Force-flushing on every
- // lifecycle event prevents this at negligible cost.
+ // Force-flush on lifecycle/error events so they survive SW termination.
const ALWAYS_FLUSH = [
"error",
"crash",
@@ -145,6 +116,12 @@ export const diagEvent = (eventType, data) => {
"alarm-fired",
"recorded-tab-closed",
"recorded-tab-navigated",
+ "drive-upload-start",
+ "drive-upload-ok",
+ "drive-upload-fail",
+ "drive-save-fail",
+ "drive-auth-fail",
+ "editor-load-ready",
];
if (ALWAYS_FLUSH.includes(eventType)) {
flush();
@@ -153,10 +130,7 @@ export const diagEvent = (eventType, data) => {
}
};
-/**
- * Close the current session with a final outcome.
- * @param {"ok"|"error"|"crashed"|"cancelled"} outcome
- */
+/** Close the current session with a final outcome. */
export const endDiagSession = async (outcome = "ok") => {
const s = currentSession();
if (!s) return;
@@ -165,22 +139,17 @@ export const endDiagSession = async (outcome = "ok") => {
await flush();
};
-/**
- * Return the full diagnostic log (for export).
- */
+/** Return the full diagnostic log (for export). */
export const getDiagnosticLog = async () => {
if (!_log) await hydrateDiagnosticLog();
return _log;
};
-/**
- * Read all scattered error-state keys and return a consolidated object.
- */
+/** Collect error-state keys from storage into one object. */
export const getErrorSnapshot = async () => {
const keys = [
"lastRecordingError",
"lastChunkSendFailure",
- "lastStartRecordingDispatch",
"recorderSession",
"freeRecorderSession",
"fastRecorderValidation",
@@ -190,6 +159,7 @@ export const getErrorSnapshot = async () => {
"fastRecorderDisabledDetails",
"fastRecorderDisabledAt",
"memoryError",
+ "recordingAttemptId",
];
try {
return await chrome.storage.local.get(keys);
@@ -198,9 +168,7 @@ export const getErrorSnapshot = async () => {
}
};
-/**
- * Read current boolean/numeric state flags for export.
- */
+/** Read current state flags for export. */
export const getStorageFlags = async () => {
const keys = [
"recording",
@@ -218,6 +186,10 @@ export const getStorageFlags = async () => {
"sandboxTab",
"recordingUiTabId",
"fastRecorderInUse",
+ "memoryError",
+ "lowStorageAbortAt",
+ "lowStorageAbortChunks",
+ "editorLoadTimeoutAt",
];
try {
return await chrome.storage.local.get(keys);
diff --git a/src/pages/utils/errorCodes.js b/src/pages/utils/errorCodes.js
new file mode 100644
index 0000000..1d3be2d
--- /dev/null
+++ b/src/pages/utils/errorCodes.js
@@ -0,0 +1,208 @@
+/**
+ * Error codes for recording flows.
+ *
+ * Codes are stored in `lastRecordingError.code` and flow through diagnostics
+ * and support context. They never contain URLs, page content, or user data.
+ */
+
+// -- Recording Start --
+export const REC_START_PERM = "REC_START_PERM"; // permission denied
+export const REC_START_STREAM = "REC_START_STREAM"; // getUserMedia / getDisplayMedia failed
+export const REC_START_CODEC = "REC_START_CODEC"; // MediaRecorder or WebCodecs init failed
+export const REC_START_REGION = "REC_START_REGION"; // region/crop target setup failed
+export const REC_START_TAB = "REC_START_TAB"; // tab capture or message routing failed
+export const REC_START_TIMEOUT = "REC_START_TIMEOUT"; // start flow timed out
+export const REC_START_CANCEL = "REC_START_CANCEL"; // user cancelled the capture picker
+export const REC_START_NOT_READY = "REC_START_NOT_READY"; // recorder tab not ready (likely discarded)
+
+// -- Recording Runtime --
+export const REC_RUN_STREAM_END = "REC_RUN_STREAM_END"; // stream ended unexpectedly
+export const REC_RUN_MEMORY = "REC_RUN_MEMORY"; // memory/quota pressure
+
+// -- Recording Stop --
+export const REC_STOP_CHUNKS = "REC_STOP_CHUNKS"; // chunk delivery failed
+export const REC_STOP_EDITOR = "REC_STOP_EDITOR"; // editor tab open failed
+
+// -- Drive --
+export const DRV_AUTH = "DRV_AUTH"; // auth failed
+export const DRV_FOLDER = "DRV_FOLDER"; // folder operation failed
+export const DRV_UPLOAD = "DRV_UPLOAD"; // file upload failed
+
+// -- Fallback --
+export const UNKNOWN = "UNKNOWN";
+
+// -- Classifier --
+
+// Patterns that strongly indicate the user explicitly cancelled the picker.
+// Note: "aborterror" is intentionally NOT here — Chrome throws AbortError for
+// picker dismissal but also for unrelated abort scenarios. We only classify
+// AbortError as cancel when the caller passes the "cancel-modal" hint.
+const CANCEL_PATTERNS = [
+ "cancelled",
+ "canceled",
+ "cancel-modal",
+ "user cancelled",
+ "user canceled",
+];
+
+const PERM_PATTERNS = [
+ "permission",
+ "not allowed",
+ "denied",
+ "notallowederror",
+ "dismissedbyuser",
+ "permission is blocked",
+];
+
+const STREAM_PATTERNS = [
+ "no video track",
+ "no audio",
+ "getusermedia",
+ "getdisplaymedia",
+ "stream unavailable",
+ "camera stream",
+ "display stream missing",
+ "failed to get user media",
+ "failed to start streaming",
+ "failed to start stream",
+ "failed to setup streaming",
+ "failed to get stream",
+ "failed to access screen stream",
+ "failed to access region stream",
+ "no streams to record",
+ "no screen video track",
+ "no camera video track",
+ "notreadableerror",
+ "notfounderror",
+ "overconstrainederror",
+];
+
+const CODEC_PATTERNS = [
+ "mediarecorder",
+ "webcodecs",
+ "failed to start recording",
+ "codec",
+ "mimeType",
+ "mime type",
+ "recording error:",
+];
+
+const TAB_PATTERNS = [
+ "no recording tab",
+ "tab stream",
+ "unable to resolve tab",
+ "tab capture",
+ "message routing",
+];
+
+const TIMEOUT_PATTERNS = [
+ "taking too long",
+ "timed out",
+ "timeout",
+];
+
+const REGION_PATTERNS = [
+ "crop target",
+ "crop region",
+ "failed to crop",
+ "region capture",
+ "no crop target",
+];
+
+/**
+ * Classify an error string into an error code.
+ *
+ * @param {string} errorStr — raw error message
+ * @param {string} [errorType] — optional hint ("stream-error", "cancel-modal", etc.)
+ * @returns {string} one of the exported error code constants
+ */
+export const classifyError = (errorStr = "", errorType = "") => {
+ const lower = String(errorStr).toLowerCase();
+ const typeLower = String(errorType).toLowerCase();
+
+ // Explicit cancel — either the caller flagged it or the message clearly says so.
+ // AbortError only counts as cancel when the caller confirms via "cancel-modal",
+ // since Chrome reuses AbortError for non-cancel scenarios too.
+ if (typeLower === "cancel-modal") {
+ return REC_START_CANCEL;
+ }
+ if (CANCEL_PATTERNS.some((p) => lower.includes(p))) {
+ return REC_START_CANCEL;
+ }
+
+ // Permission denied
+ if (PERM_PATTERNS.some((p) => lower.includes(p))) {
+ return REC_START_PERM;
+ }
+
+ // Recorder not ready (stream ref missing, likely tab discarded during countdown)
+ if (lower.includes("recording not ready") || lower.includes("screen stream is missing")) {
+ return REC_START_NOT_READY;
+ }
+
+ // Stream acquisition
+ if (STREAM_PATTERNS.some((p) => lower.includes(p))) {
+ return REC_START_STREAM;
+ }
+
+ // Codec / recorder init
+ if (CODEC_PATTERNS.some((p) => lower.includes(p))) {
+ return REC_START_CODEC;
+ }
+
+ // Timeout
+ if (TIMEOUT_PATTERNS.some((p) => lower.includes(p))) {
+ return REC_START_TIMEOUT;
+ }
+
+ // Region / crop
+ if (REGION_PATTERNS.some((p) => lower.includes(p))) {
+ return REC_START_REGION;
+ }
+
+ // Stream ended (runtime, not start)
+ if (typeLower === "stream-ended" || lower.includes("stream ended")) {
+ return REC_RUN_STREAM_END;
+ }
+
+ // Tab routing
+ if (TAB_PATTERNS.some((p) => lower.includes(p))) {
+ return REC_START_TAB;
+ }
+
+ // Memory / storage
+ if (
+ lower.includes("memory") ||
+ lower.includes("quota") ||
+ lower.includes("indexeddb") ||
+ lower.includes("local storage is blocked") ||
+ lower.includes("local buffer")
+ ) {
+ return REC_RUN_MEMORY;
+ }
+
+ // Bare AbortError without a cancel-modal hint — this is ambiguous, so treat
+ // it as a stream-level failure rather than assuming user intent.
+ if (lower.includes("aborterror")) {
+ return REC_START_STREAM;
+ }
+
+ return UNKNOWN;
+};
+
+// -- Helpers --
+
+/** Short ID for a recording attempt (no crypto dependency). */
+export const makeRecordingAttemptId = () => {
+ const ts = Date.now().toString(36);
+ const rand = Math.random().toString(36).slice(2, 8);
+ return `ra-${ts}-${rand}`;
+};
+
+/** Derive a short support code from an attempt ID. */
+export const makeSupportCode = (attemptId) => {
+ if (!attemptId) return "SCR-0000";
+ const hash = attemptId.replace(/[^a-z0-9]/gi, "").slice(-4).toUpperCase();
+ const date = new Date().toISOString().slice(0, 10).replace(/-/g, "");
+ return `SCR-${hash}-${date}`;
+};
diff --git a/src/pages/utils/recordingDebug.js b/src/pages/utils/recordingDebug.js
index 585ae3b..9884f5f 100644
--- a/src/pages/utils/recordingDebug.js
+++ b/src/pages/utils/recordingDebug.js
@@ -76,8 +76,6 @@ export const debugRecordingEventWithSession = (session, eventType, payload) => {
try {
chrome.runtime?.sendMessage?.({
type: "recdbg",
- action: "recdbg",
- kind: "RECDBG",
eventType,
payload,
sessionId: activeSession?.sessionId || null,
diff --git a/webpack.config.js b/webpack.config.js
index 742fe1f..cc56e8c 100755
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -224,6 +224,9 @@ const config = {
"process.env.RECORDING_WARNING_THRESHOLD": JSON.stringify(
process.env.RECORDING_WARNING_THRESHOLD || 60 // Default to 1 minute
),
+ "process.env.SCREENITY_DEV_MODE": JSON.stringify(
+ process.env.SCREENITY_DEV_MODE || ""
+ ),
}),
// Copy manifest and transform with package info