The free and privacy-friendly screen recorder with no limits 🎥
JavaScript annotationannotation-toolaudiocamerachrome-extensiondesigneditorffmpegjavascriptproductivityrecorderscreen-capturescreen-recorderscreencasttensorflowvideo
Auth re-login recovery, OPFS editor load reliability, faster cloud recorder warmup
Alyssa X316784800e67
diff --git a/package.json b/package.jsonindex 7dd1db1..90a68a4 100755--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "screenity",- "version": "4.4.8",+ "version": "4.4.9","description": "The free and privacy-friendly screen recorder with no sign in needed.","scripts": {"build": "cross-env NODE_ENV=production node utils/build.js",diff --git a/src/manifest.json b/src/manifest.jsonindex bd3a09c..1867ba9 100755--- a/src/manifest.json+++ b/src/manifest.json@@ -3,7 +3,7 @@"name": "__MSG_extName__","description": "__MSG_extDesc__","default_locale": "en",- "version": "4.4.8",+ "version": "4.4.9","background": {"service_worker": "background.bundle.js"},diff --git a/src/pages/Background/auth/loginWithWebsite.js b/src/pages/Background/auth/loginWithWebsite.jsindex 212e192..11852f7 100644--- a/src/pages/Background/auth/loginWithWebsite.js+++ b/src/pages/Background/auth/loginWithWebsite.js@@ -25,7 +25,23 @@ const fetchWithTimeout = (url, opts = {}) => {);};-export const loginWithWebsite = async (_depth = 0) => {+const recordSubscriptionLoss = async (reason, extra = {}) => {+ try {+ await chrome.storage.local.set({+ lastSubscriptionLoss: {+ ts: Date.now(),+ reason,+ ...extra,+ },+ });+ } catch {}+};++// force=true bypasses stayLoggedOut and the prior-signals gate, so+// user-initiated paths can recover via cookie refresh after explicit logout.+export const loginWithWebsite = async (arg = {}) => {+ const _depth = typeof arg === "number" ? arg : Number(arg._depth) || 0;+ const force = typeof arg === "object" && arg !== null ? Boolean(arg.force) : false;if (!CLOUD_FEATURES_ENABLED) {return { authenticated: false, instantMode: false };}@@ -34,19 +50,72 @@ export const loginWithWebsite = async (_depth = 0) => {// separate gets here added ~30-60ms of serial round-trips on the// start critical path; consolidating doesn't change semantics but// shaves a few ms off every recording start.- const { stayLoggedOut, screenityToken, lastAuthCheck, instantMode } =- await chrome.storage.local.get([- "stayLoggedOut",- "screenityToken",- "lastAuthCheck",- "instantMode",- ]);+ const {+ stayLoggedOut,+ screenityToken,+ lastAuthCheck,+ instantMode,+ wasLoggedIn,+ hasSubscribedBefore,+ screenityUser,+ } = await chrome.storage.local.get([+ "stayLoggedOut",+ "screenityToken",+ "lastAuthCheck",+ "instantMode",+ "wasLoggedIn",+ "hasSubscribedBefore",+ "screenityUser",+ ]);- if (stayLoggedOut) {+ if (stayLoggedOut && !force) {return { authenticated: false, instantMode: false };}if (!screenityToken) {+ // gated on prior signals; force bypasses the gate.+ const hasPriorSignals =+ Boolean(wasLoggedIn) ||+ Boolean(hasSubscribedBefore) ||+ Boolean(screenityUser);+ const shouldTryRefresh = force || hasPriorSignals;+ if (shouldTryRefresh && _depth < MAX_REFRESH_DEPTH && API_BASE) {+ try {+ const refreshRes = await fetchWithTimeout(+ `${API_BASE}/auth/refresh`,+ { credentials: "include" },+ );+ if (refreshRes.ok) {+ const { token: newToken } = await refreshRes.json();+ if (newToken) {+ // also clear stayLoggedOut on force so non-force calls work next time.+ const writes = { screenityToken: newToken };+ if (force) writes.stayLoggedOut = false;+ await chrome.storage.local.set(writes);+ return await loginWithWebsite({ _depth: _depth + 1, force });+ }+ }+ // only mark as subscription loss for users with prior-Pro evidence.+ if (hasPriorSignals) {+ await recordSubscriptionLoss("refresh-failed-no-token", {+ status: refreshRes.status,+ hadPriorSignals: true,+ });+ }+ } catch (refreshErr) {+ if (hasPriorSignals) {+ await recordSubscriptionLoss("refresh-threw", {+ err: String(refreshErr?.message || refreshErr).slice(0, 200),+ hadPriorSignals: true,+ });+ }+ }+ } else if (hasPriorSignals) {+ await recordSubscriptionLoss("no-token-no-refresh-allowed", {+ hadPriorSignals: true,+ depth: _depth,+ });+ }// Don't block the start path on this write; it's just a UI flag// that will get re-read on next mount.chrome.storage.local.set({ isLoggedIn: false });@@ -76,6 +145,7 @@ export const loginWithWebsite = async (_depth = 0) => {onboarding: false,isLoggedIn: true,wasLoggedIn: false,+ stayLoggedOut: false,...(!instantMode? {backgroundEffectsActive: false,@@ -121,6 +191,7 @@ export const loginWithWebsite = async (_depth = 0) => {lastAuthCheck: now,isLoggedIn: true,wasLoggedIn: false,+ stayLoggedOut: false,isSubscribed: subscribed,proSubscription: subscription,hasSubscribedBefore: !!hasSubscribedBefore,@@ -173,9 +244,10 @@ export const loginWithWebsite = async (_depth = 0) => {);if (refreshRes.ok) {const { token: newToken } = await refreshRes.json();- await chrome.storage.local.set({ screenityToken: newToken });-- return await loginWithWebsite(_depth + 1);+ const writes = { screenityToken: newToken };+ if (force) writes.stayLoggedOut = false;+ await chrome.storage.local.set(writes);+ return await loginWithWebsite({ _depth: _depth + 1, force });}} catch (refreshErr) {console.error("❌ Refresh failed:", refreshErr.message);@@ -191,6 +263,9 @@ export const loginWithWebsite = async (_depth = 0) => {"proSubscription",]);await chrome.storage.local.set({ isLoggedIn: false });+ await recordSubscriptionLoss("token-invalid-refresh-failed", {+ depth: _depth,+ });return { authenticated: false, instantMode: false };}@@ -231,6 +306,9 @@ export const loginWithWebsite = async (_depth = 0) => {}await chrome.storage.local.set({ isLoggedIn: false });+ await recordSubscriptionLoss("verify-transient-no-cached-user", {+ err: String(err?.message || err).slice(0, 200),+ });return {authenticated: false,instantMode: instantMode || false,diff --git a/src/pages/Background/listeners/onActionButtonClickedListener.js b/src/pages/Background/listeners/onActionButtonClickedListener.jsindex caff76d..ce9fa69 100644--- a/src/pages/Background/listeners/onActionButtonClickedListener.js+++ b/src/pages/Background/listeners/onActionButtonClickedListener.js@@ -70,7 +70,7 @@ const openPlaygroundOrPopup = async (tab) => {});if (CLOUD_FEATURES_ENABLED) {- const result = await loginWithWebsite();+ const result = await loginWithWebsite({ force: true });if (result?.authenticated) {await chrome.storage.local.set({diff --git a/src/pages/Background/listeners/onInstalledListener.js b/src/pages/Background/listeners/onInstalledListener.jsindex 85391a9..cbacada 100644--- a/src/pages/Background/listeners/onInstalledListener.js+++ b/src/pages/Background/listeners/onInstalledListener.js@@ -36,6 +36,14 @@ export const onInstalledListener = () => {}});} else if (details.reason === "update") {+ // give WebCodecs a fresh shot on update: a one-time watchdog trip on+ // an older build shouldn't permanently pin a user to MediaRecorder.+ chrome.storage.local.remove([+ "fastRecorderDisabledForDevice",+ "fastRecorderDisabledReason",+ "fastRecorderDisabledAt",+ "fastRecorderDisabledDetails",+ ]);if (details.previousVersion === "2.8.6") {chrome.storage.local.set({ updatingFromOld: true });} else {diff --git a/src/pages/Background/listeners/onMessageExternalListener.js b/src/pages/Background/listeners/onMessageExternalListener.jsindex f203863..ae9d4a0 100644--- a/src/pages/Background/listeners/onMessageExternalListener.js+++ b/src/pages/Background/listeners/onMessageExternalListener.js@@ -121,7 +121,7 @@ export const onMessageExternalListener = () => {});}- const result = await loginWithWebsite();+ const result = await loginWithWebsite({ force: true });if (!result?.authenticated) {const currentTab = await getCurrentTab();diff --git a/src/pages/Background/listeners/onStartupListener.js b/src/pages/Background/listeners/onStartupListener.jsindex 984d215..e347802 100644--- a/src/pages/Background/listeners/onStartupListener.js+++ b/src/pages/Background/listeners/onStartupListener.js@@ -1,4 +1,8 @@import { tryResumePendingUploads } from "../recording/resumePendingUploads";+import { loginWithWebsite } from "../auth/loginWithWebsite";++const CLOUD_FEATURES_ENABLED =+ process.env.SCREENITY_ENABLE_CLOUD_FEATURES === "true";// For some reason without this the service worker doesn't always workexport const onStartupListener = async () => {@@ -9,5 +13,22 @@ export const onStartupListener = async () => {setTimeout(() => {tryResumePendingUploads({ trigger: "onStartup" }).catch(() => {});}, 5000);+ // pick up a web login that fired AUTH_SUCCESS while the SW was asleep.+ // gated on signals so fresh installs don't hammer /auth/refresh.+ if (CLOUD_FEATURES_ENABLED) {+ chrome.storage.local+ .get(["wasLoggedIn", "hasSubscribedBefore", "screenityUser", "screenityToken"])+ .then((s) => {+ if (+ s.wasLoggedIn ||+ s.hasSubscribedBefore ||+ s.screenityUser ||+ s.screenityToken+ ) {+ loginWithWebsite({ force: true }).catch(() => {});+ }+ })+ .catch(() => {});+ }});};diff --git a/src/pages/Background/listeners/onTabUpdatedListener.js b/src/pages/Background/listeners/onTabUpdatedListener.jsindex fd93ab2..51e1c7c 100644--- a/src/pages/Background/listeners/onTabUpdatedListener.js+++ b/src/pages/Background/listeners/onTabUpdatedListener.js@@ -1,5 +1,24 @@import { sendMessageTab } from "../tabManagement";import { diagEvent } from "../../utils/diagnosticLog";+import { loginWithWebsite } from "../auth/loginWithWebsite";++const CLOUD_FEATURES_ENABLED =+ process.env.SCREENITY_ENABLE_CLOUD_FEATURES === "true";+const APP_BASE = process.env.SCREENITY_APP_BASE;+// debounce in-tab triggers so navigation chatter doesn't hammer /auth/refresh+const APP_AUTH_REFRESH_DEBOUNCE_MS = 10_000;+let lastAppAuthRefreshAt = 0;+const tryAppAuthRefresh = async (url) => {+ if (!CLOUD_FEATURES_ENABLED || !APP_BASE || !url) return;+ if (!url.startsWith(APP_BASE)) return;+ const now = Date.now();+ if (now - lastAppAuthRefreshAt < APP_AUTH_REFRESH_DEBOUNCE_MS) return;+ // skip when already authed; AUTH_SUCCESS is the fast path.+ const { isLoggedIn } = await chrome.storage.local.get(["isLoggedIn"]);+ if (isLoggedIn) return;+ lastAppAuthRefreshAt = now;+ loginWithWebsite({ force: true }).catch(() => {});+};export const handleTabUpdate = async (tabId, changeInfo, tab) => {try {@@ -89,6 +108,8 @@ export const handleTabUpdate = async (tabId, changeInfo, tab) => {) {sendMessageTab(tab.id, { type: "toggle-popup" });}+ // if we look logged out, try a force refresh in case AUTH_SUCCESS was missed.+ tryAppAuthRefresh(tab.url).catch(() => {});}} catch (error) {console.error("Error in handleTabUpdate:", error.message);diff --git a/src/pages/Background/messaging/handlers.js b/src/pages/Background/messaging/handlers.jsindex 898df6d..41d0b12 100644--- a/src/pages/Background/messaging/handlers.js+++ b/src/pages/Background/messaging/handlers.js@@ -465,7 +465,7 @@ const handleCheckStorageQuota = async (retried = false) => {// 401: invalidate auth cache so loginWithWebsite refreshes the tokenif (res.status === 401 && !retried) {await chrome.storage.local.set({ lastAuthCheck: 0 });- const refresh = await loginWithWebsite();+ const refresh = await loginWithWebsite({ force: true });if (refresh.authenticated) {return handleCheckStorageQuota(true);}@@ -1207,24 +1207,41 @@ export const setupHandlers = () => {"restarting","pendingRecording",]);- // restart leaves `recording: true` briefly from the previous session, so block- // only when recording is active AND not restarting- if (recording && !restarting) {- diagEvent("countdown-finished", { skipped: true, reason: "already-recording" });+ const writeDecision = (reason, started, extra = {}) => {const decisionAt = Date.now();- await chrome.storage.local.set({+ return chrome.storage.local.set({lastCountdownFinishedDecision: {ts: decisionAt,- startedAt: null,+ startedAt: started ? decisionAt : null,endedAt: message?.endedAt || null,- acceptedCountdownFinishedAt: false,+ acceptedCountdownFinishedAt: started,recording: Boolean(recording),restarting: Boolean(restarting),pendingRecording: Boolean(pendingRecording),- started: false,- reason: "already-recording",+ started,+ reason,+ ...extra,},});+ };+ // restart leaves `recording: true` briefly from the previous session, so block+ // only when recording is active AND not restarting+ if (recording && !restarting) {+ diagEvent("countdown-finished", { skipped: true, reason: "already-recording" });+ await writeDecision("already-recording", false);+ return { ok: true, skipped: true };+ }+ // a delayed countdown-finished can fire long after stop; accepting it+ // starts a phantom recording that orphans the finished editor handoff.+ const endedAt = Number(message?.endedAt) || 0;+ const ageMs = endedAt > 0 ? Date.now() - endedAt : null;+ if (ageMs !== null && ageMs > 10000) {+ diagEvent("countdown-finished", {+ skipped: true,+ reason: "stale-dispatch",+ ageMs,+ });+ await writeDecision("stale-dispatch", false, { ageMs });return { ok: true, skipped: true };}diagEvent("countdown-finished", { skipped: false });@@ -1401,7 +1418,16 @@ export const setupHandlers = () => {registerMessage("diag-forward", (message) => {const ev = typeof message?.event === "string" ? message.event : null;if (!ev) return;- const allowedPrefixes = ["sandbox-", "sw-", "opfs-", "recorder-"];+ const allowedPrefixes = [+ "sandbox-",+ "sw-",+ "opfs-",+ "recorder-",+ // emit real failure breadcrumbs; were being silently dropped before.+ "cloudrecorder-",+ "camera-",+ "editor-",+ ];if (!allowedPrefixes.some((p) => ev.startsWith(p))) return;diagEvent(ev, message?.data ?? null);});@@ -1456,7 +1482,7 @@ export const setupHandlers = () => {// cloud-enabled signed-in users skip local fast-MP4 recovery to stay on the pro flowif (CLOUD_FEATURES_ENABLED) {try {- const { authenticated } = await loginWithWebsite();+ const { authenticated } = await loginWithWebsite({ force: true });if (authenticated) {const tab = await getCurrentTab();if (tab?.id) {@@ -1561,7 +1587,7 @@ export const setupHandlers = () => {let isLoggedIn = false;if (CLOUD_FEATURES_ENABLED) {try {- const auth = await loginWithWebsite();+ const auth = await loginWithWebsite({ force: true });if (auth.authenticated && auth.user) {user = auth.user;isLoggedIn = true;@@ -1732,7 +1758,8 @@ export const setupHandlers = () => {message: "Cloud features disabled",};}- return await loginWithWebsite();+ // force so a fresh web login is picked up even after explicit logout.+ return await loginWithWebsite({ force: true });},);registerMessage(@@ -1742,7 +1769,7 @@ export const setupHandlers = () => {sendResponse({ success: false, message: "Cloud features disabled" });return true;}- const { authenticated, subscribed, user } = await loginWithWebsite();+ const { authenticated, subscribed, user } = await loginWithWebsite({ force: true });if (!authenticated) {sendResponse({ success: false, message: "User not authenticated" });@@ -1999,7 +2026,7 @@ export const setupHandlers = () => {sendResponse({ success: false, message: "Cloud features disabled" });return true;}- const { authenticated, subscribed, user } = await loginWithWebsite();+ const { authenticated, subscribed, user } = await loginWithWebsite({ force: true });if (!authenticated) {sendResponse({ success: false, message: "User not authenticated" });@@ -2030,7 +2057,7 @@ export const setupHandlers = () => {sendResponse({ success: false, error: "Cloud features disabled" });return true;}- const authResult = await loginWithWebsite();+ const authResult = await loginWithWebsite({ force: true });const { authenticated, subscribed } = authResult;if (!authenticated) {@@ -2490,7 +2517,7 @@ export const setupHandlers = () => {console.warn("Cloud features disabled");return;}- const { authenticated } = await loginWithWebsite();+ const { authenticated } = await loginWithWebsite({ force: true });if (!authenticated) {console.warn("User not authenticated, cannot open account settings");return;@@ -2504,7 +2531,7 @@ export const setupHandlers = () => {console.warn("Cloud features disabled");return;}- const { authenticated, user } = await loginWithWebsite();+ const { authenticated, user } = await loginWithWebsite({ force: true });if (!authenticated || !user) {console.warn("User not authenticated, cannot open support");return;@@ -2559,7 +2586,7 @@ export const setupHandlers = () => {registerMessage("refresh-auth", async () => {if (!CLOUD_FEATURES_ENABLED)return { success: false, message: "Cloud features disabled" };- return await loginWithWebsite();+ return await loginWithWebsite({ force: true });});registerMessage("sync-recording-state", async (message, sendResponse) => {const {diff --git a/src/pages/Background/recording/openRecorderTab.js b/src/pages/Background/recording/openRecorderTab.jsindex ea767fe..7ab1c29 100644--- a/src/pages/Background/recording/openRecorderTab.js+++ b/src/pages/Background/recording/openRecorderTab.js@@ -23,7 +23,7 @@ const openRecorderTab = async (let switchTab = true;const endLogin = perfSpan("BG.openRecorderTab loginWithWebsite");- const { authenticated, subscribed, cached, transient, error: authError } = await loginWithWebsite();+ const { authenticated, subscribed, cached, transient, error: authError } = await loginWithWebsite({ force: true });endLogin({ authenticated, subscribed, cached: Boolean(cached) });const isCloudRecorder = authenticated && subscribed;const recorderUrl = isCloudRecorderdiff --git a/src/pages/Background/recording/startRecording.js b/src/pages/Background/recording/startRecording.jsindex 9640bf1..0a648a3 100644--- a/src/pages/Background/recording/startRecording.js+++ b/src/pages/Background/recording/startRecording.js@@ -73,8 +73,53 @@ export const startRecording = async (caller = "unknown") => {}};+// a real back-to-back always goes through the 3s countdown, so a countdown-+// finished start landing sooner than this after stop is stale.+const STALE_START_WINDOW_MS = 3000;+const _startRecordingInner = async (caller) => {const recordingAttemptId = makeRecordingAttemptId();+ // only gate countdown-finished; direct/fallback/restart don't share it.+ try {+ const { recordingStoppedAt, recording, restarting } =+ await chrome.storage.local.get([+ "recordingStoppedAt",+ "recording",+ "restarting",+ ]);+ const sinceStopMs =+ typeof recordingStoppedAt === "number"+ ? Date.now() - recordingStoppedAt+ : null;+ if (+ caller === "countdown-finished" &&+ sinceStopMs !== null &&+ sinceStopMs < STALE_START_WINDOW_MS &&+ !recording &&+ !restarting+ ) {+ console.warn(+ "[Screenity][BG] startRecording aborted: prior recording stopped",+ sinceStopMs,+ "ms ago, caller:",+ caller,+ );+ try {+ chrome.storage.local.set({+ lastStartAborted: {+ ts: Date.now(),+ caller,+ sinceStopMs,+ reason: "rapid-restart-after-stop",+ },+ // clear so the start-in-flight guard stops shielding cleanup.+ recordingStartingAt: null,+ pendingRecording: false,+ });+ } catch {}+ return;+ }+ } catch {}// Diagnostic-only snapshot of residual state; runs async so it// doesn't block the actual start path. ~17-key storage read can// cost 30-80ms on a contended SW and there's no consumer thatdiff --git a/src/pages/Background/recording/stopRecording.js b/src/pages/Background/recording/stopRecording.jsindex 85845e5..1ef7f86 100644--- a/src/pages/Background/recording/stopRecording.js+++ b/src/pages/Background/recording/stopRecording.js@@ -178,6 +178,8 @@ export const stopRecording = async () => {recordingUiTabId: null,pipForceClose: Date.now(),recordingStartTime: 0,+ // marker for the start-path rapid-restart guard.+ recordingStoppedAt: Date.now(),});const {@@ -812,6 +814,7 @@ export const handleStopRecordingTabBackup = async (request) => {recording: false,restarting: false,tabRecordedID: null,+ recordingStoppedAt: Date.now(),...(isMemoryError ? { memoryError: true } : {}),});sendMessageRecord({ type: "stop-recording-tab" });diff --git a/src/pages/Background/tabManagement/setSurface.js b/src/pages/Background/tabManagement/setSurface.jsindex 96017f7..c400a3d 100644--- a/src/pages/Background/tabManagement/setSurface.js+++ b/src/pages/Background/tabManagement/setSurface.js@@ -4,7 +4,7 @@ import { loginWithWebsite } from "../auth/loginWithWebsite";export const setSurface = async (request) => {await chrome.storage.local.set({ surface: request.surface });- const result = await loginWithWebsite();+ const result = await loginWithWebsite({ force: true });const { activeTab } = await chrome.storage.local.get(["activeTab"]);sendMessageTab(activeTab, {diff --git a/src/pages/CloudRecorder/CloudRecorder.jsx b/src/pages/CloudRecorder/CloudRecorder.jsxindex a8b776e..b72f137 100644--- a/src/pages/CloudRecorder/CloudRecorder.jsx+++ b/src/pages/CloudRecorder/CloudRecorder.jsx@@ -13,6 +13,11 @@ import { traceStep } from "../utils/startFlowTrace";import { IS_OFFSCREEN_HOST } from "../utils/recordingHost";import { startPrewarm, stopPrewarm } from "../Recorder/streamWarmup";import { preloadWebCodecsModules } from "../Recorder/webcodecs/WebCodecsRecorder";+import {+ startEncoderPrewarm,+ closeActiveEncoderPrewarm,+} from "../Recorder/encoderPrewarm";+import { perfMark } from "../utils/perfMarks";import {chooseChunksStore,openExistingChunksStore,@@ -5721,6 +5726,45 @@ const CloudRecorder = () => {.getVideoTracks()[0].getSettings();+ // warm the OS encoder so the real one hits 30fps from frame 1+ // instead of crawling for the first ~30 frames. mirrors Recorder.jsx.+ try {+ const w = Number(settings.width) || 0;+ const h = Number(settings.height) || 0;+ if (w > 0 && h > 0) {+ const { fastRecorderProbe } = await chrome.storage.local.get([+ "fastRecorderProbe",+ ]);+ const probeConfig =+ fastRecorderProbe?.details?.selectedVideoConfig || null;+ perfMark("CloudRecorder.encoderPrewarm.fired", {+ w,+ h,+ codec: probeConfig?.codec || "avc1.4D401F",+ framerate:+ Number(settings.frameRate) ||+ Number(probeConfig?.framerate) ||+ 30,+ });+ void startEncoderPrewarm({+ width: w,+ height: h,+ codec: probeConfig?.codec || "avc1.4D401F",+ bitrate: Number(probeConfig?.bitrate) || 4_000_000,+ framerate:+ Number(settings.frameRate) ||+ Number(probeConfig?.framerate) ||+ 30,+ });+ } else {+ perfMark("CloudRecorder.encoderPrewarm.skipped", { reason: "no-size" });+ }+ } catch (err) {+ perfMark("CloudRecorder.encoderPrewarm.failed", {+ err: String(err?.message || err).slice(0, 120),+ });+ }+traceStep("streamAcquired", { surface: surface || null });setTimeout(() => {diff --git a/src/pages/CloudRecorder/encoder/WebCodecsTrackRecorder.js b/src/pages/CloudRecorder/encoder/WebCodecsTrackRecorder.jsindex 53d1c1a..0cd9f3a 100644--- a/src/pages/CloudRecorder/encoder/WebCodecsTrackRecorder.js+++ b/src/pages/CloudRecorder/encoder/WebCodecsTrackRecorder.js@@ -3,6 +3,7 @@// fragments come out as Blobs via ondataavailable.import { WebCodecsRecorder } from "../../Recorder/webcodecs/WebCodecsRecorder";+import { closeActiveEncoderPrewarm } from "../../Recorder/encoderPrewarm";const dispatchError = (cb, err) => {if (typeof cb !== "function") return;@@ -121,9 +122,12 @@ export class WebCodecsTrackRecorder {// underlying recorder.start() is async; dispatch and don't block,// since MediaRecorder.start() is sync to the caller and startup// errors flow through onerror.- Promise.resolve(this._recorder.start()).catch((err) => {- handleError(err);- });+ // release the synthetic prewarm encoder's HW slot before the real one+ // opens, otherwise VideoToolbox contends for the first ~30 frames.+ Promise.resolve()+ .then(() => closeActiveEncoderPrewarm().catch(() => {}))+ .then(() => this._recorder.start())+ .catch((err) => handleError(err));}pause() {diff --git a/src/pages/Content/context/ContentState.jsx b/src/pages/Content/context/ContentState.jsxindex d3693a0..247ce11 100644--- a/src/pages/Content/context/ContentState.jsx+++ b/src/pages/Content/context/ContentState.jsx@@ -276,6 +276,8 @@ const ContentState = (props) => {}, []);const stopRecording = useCallback(() => {+ // re-entry guard: if a previous stop is still finalizing, ignore.+ if (contentStateRef.current.finalizingRecording) return;chrome.runtime.sendMessage({ type: "clear-recording-alarm" });const isMulti = contentStateRef.current.multiMode;// Preserve the user's tool state in multi-mode so they keep their@@ -1689,23 +1691,20 @@ const ContentState = (props) => {: prev,);}- // Recording true → false: clear any local flow state that- // the sandboxTab listener might have missed on a hidden tab- // (Chrome suspends bg tabs; sandboxTab listener may not fire- // until the user returns). Prevents the stale "Preparing..."- // loader showing when the user reopens the popup.+ // Recording true → false: clear start-side flow flags the+ // sandboxTab listener might have missed on a hidden tab. Leave+ // finalizingRecording alone so the toolbar stop button stays+ // disabled until sandboxTab (or the 30s watchdog) lands.if (changes.recording.oldValue === true &&changes.recording.newValue === false) {setContentState((prev) =>- prev.finalizingRecording ||prev.preparingRecording ||prev.pendingRecording ||prev.restartingRecording? {...prev,- finalizingRecording: false,preparingRecording: false,pendingRecording: false,restartingRecording: false,diff --git a/src/pages/Recorder/webcodecs/WebCodecsRecorder.js b/src/pages/Recorder/webcodecs/WebCodecsRecorder.jsindex ba4229c..cf3779b 100644--- a/src/pages/Recorder/webcodecs/WebCodecsRecorder.js+++ b/src/pages/Recorder/webcodecs/WebCodecsRecorder.js@@ -10,6 +10,7 @@* canvas resizing, pause/resume, and chunked output.*/import { perfMark, perfSpan } from "../../utils/perfMarks";+import { diagForward } from "../../utils/diagForward";// Lazy-load Mp4MuxerWrapper so its ~3MB mediabunny static import doesn't// drag into recorder.bundle.js cold start (dominates click-record latency).let _mp4MuxerWrapperPromise = null;@@ -914,6 +915,16 @@ export class WebCodecsRecorder {deviceChanges: this._deviceChangeCount || 0,};}+ // breadcrumb at the failure instant; onError alone doesn't land in the+ // diag session log.+ diagForward("recorder-webcodecs-failure", {+ code: err.code || code || null,+ framesEncoded: this.frameCount,+ firstChunkSeen: this._firstChunkSeen,+ swRetry: this._didSwRetry ? this._swRetryReason || true : false,+ reclaims: this._encoderReclaimCount + this._audioEncoderReclaimCount,+ visibilityChanges: this._visibilityChangeCount,+ });try {this.options.onError?.(err);} catch (cbErr) {@@ -933,6 +944,16 @@ export class WebCodecsRecorder {state: document.visibilityState,count: this._visibilityChangeCount,});+ // tab came back to focus before we saw a first chunk; reset the+ // watchdog so the encoder gets a fresh full window post-throttle.+ if (+ document.visibilityState === "visible" &&+ this.running &&+ !this._stopping &&+ !this._firstChunkSeen+ ) {+ this._armFirstChunkWatchdog();+ }};try {document.addEventListener(@@ -1004,6 +1025,15 @@ export class WebCodecsRecorder {this._firstChunkWatchdog = setTimeout(() => {this._firstChunkWatchdog = null;if (!this.running || this._stopping || this._firstChunkSeen) return;+ // tab is hidden so the encoder may be throttled; re-arm and let the+ // visibilitychange handler restart the clock on return.+ if (+ typeof document !== "undefined" &&+ document.visibilityState === "hidden"+ ) {+ this._armFirstChunkWatchdog();+ return;+ }this.warn(`[WCR] no encoded video chunk within ${this._firstChunkWatchdogMs}ms`,);@@ -1187,16 +1217,16 @@ export class WebCodecsRecorder {error: videoEncoderError,});- // configure() can throw sync. On QuotaExceeded or generic failure- // with prefer-hardware, retry once with prefer-software (Teams/- // Zoom contention, NVIDIA 3-encoder cap). HW → SW → MR.+ // configure() can throw sync. retry hardware→software on quota/contention+ // (Teams/Zoom, NVIDIA 3-encoder cap); if SW also contends, cooldown and+ // retry HW once (slot releases in a sec or two). HW → SW → cooldown → HW.const tryConfigureWith = (cfg) => {// E2E hook: force one HW configure() to throw QuotaExceededError so- // tests can exercise the prefer-software retry path. Mirrors- // __screenityForceZeroFrames; one-shot.+ // tests can exercise the prefer-software retry path. One-shot.const hwPref =cfg.hardwareAcceleration === "prefer-hardware" ||!cfg.hardwareAcceleration;+ const swPref = cfg.hardwareAcceleration === "prefer-software";const g = /** @type {any} */ (globalThis);if (hwPref &&@@ -1210,8 +1240,51 @@ export class WebCodecsRecorder {forced.name = "QuotaExceededError";throw forced;}+ // Companion E2E hook so a test can simulate "both HW and SW are+ // contended" and exercise the cooldown retry path.+ if (+ swPref &&+ g.__screenityForceConfigureSwQuotaError &&+ !g.__screenityForceConfigureSwQuotaError_fired+ ) {+ g.__screenityForceConfigureSwQuotaError_fired = true;+ const forced = new Error(+ "Forced SW configure quota error for testing",+ );+ forced.name = "QuotaExceededError";+ throw forced;+ }this.videoEncoder.configure(cfg);};+ const rebuildEncoder = () => {+ try {+ this.videoEncoder.close();+ } catch {}+ this.videoEncoder = new VideoEncoder({+ output: videoEncoderOutput,+ error: videoEncoderError,+ });+ };+ const isContention = (err) => {+ const msg = String(err?.message || err || "");+ return (+ err?.name === "QuotaExceededError" ||+ /quota|too many|in use|already|reclaimed/i.test(msg)+ );+ };+ const buildBusyError = (cause, codecLabel) => {+ // the raw DOMException ("Codec reclaimed due to inactivity") is opaque;+ // give a user-facing message. errorCodes.js still maps to REC_START_CODEC.+ const tagged = new Error(+ "Another app appears to be using the video encoder. Close apps like Zoom, Teams or OBS and try again.",+ );+ tagged.cause = cause;+ tagged.codec = codecLabel;+ tagged.code = "video-encoder-busy";+ tagged.swRetryReason = this._swRetryReason || null;+ tagged.cooldownRetried = Boolean(this._didCooldownRetry);+ return tagged;+ };try {tryConfigureWith(config);} catch (err) {@@ -1219,9 +1292,7 @@ export class WebCodecsRecorder {config.hardwareAcceleration === "prefer-hardware" ||!config.hardwareAcceleration;const errMsg = String(err?.message || err || "");- const isContentionError =- err?.name === "QuotaExceededError" ||- /quota|too many|in use|already/i.test(errMsg);+ const isContentionError = isContention(err);if (isHwPreferred && !this._didSwRetry) {this._didSwRetry = true;this._swRetryReason = isContentionError@@ -1231,15 +1302,7 @@ export class WebCodecsRecorder {"[WCR] HW VideoEncoder.configure failed, retrying prefer-software",{ reason: this._swRetryReason, codec: codecLabel, message: errMsg },);- // Rebuild the encoder: configure() on a closed/errored encoder- // throws InvalidStateError on subsequent calls.- try {- this.videoEncoder.close();- } catch {}- this.videoEncoder = new VideoEncoder({- output: videoEncoderOutput,- error: videoEncoderError,- });+ rebuildEncoder();const swConfig = { ...config, hardwareAcceleration: "prefer-software" };try {tryConfigureWith(swConfig);@@ -1247,6 +1310,60 @@ export class WebCodecsRecorder {this._activeVideoConfig = swConfig;return;} catch (swErr) {+ // both HW and SW threw contention: the OS slot is likely held+ // transiently, so one pause + retry recovers on the Windows traces.+ if (+ isContention(swErr) &&+ isContentionError &&+ !this._didCooldownRetry+ ) {+ this._didCooldownRetry = true;+ const cooldownMs = Number.isFinite(+ this.options.encoderConfigureCooldownMs,+ )+ ? this.options.encoderConfigureCooldownMs+ : 1500;+ this.warn(+ "[WCR] both HW and SW configure threw contention; cooling down before retry",+ {+ codec: codecLabel,+ cooldownMs,+ hwMessage: errMsg,+ swMessage: String(swErr?.message || swErr || ""),+ },+ );+ await new Promise((r) => setTimeout(r, cooldownMs));+ rebuildEncoder();+ try {+ tryConfigureWith(config);+ this.log(+ "[WCR] VideoEncoder configured after cooldown retry",+ { codec: codecLabel },+ );+ this._activeVideoConfig = config;+ return;+ } catch (retryErr) {+ this.warn(+ "[WCR] cooldown HW retry failed; trying SW once more",+ {+ codec: codecLabel,+ message: String(retryErr?.message || retryErr || ""),+ },+ );+ rebuildEncoder();+ try {+ tryConfigureWith(swConfig);+ this.log(+ "[WCR] VideoEncoder configured (SW after cooldown)",+ { codec: codecLabel },+ );+ this._activeVideoConfig = swConfig;+ return;+ } catch (finalErr) {+ throw buildBusyError(finalErr, codecLabel);+ }+ }+ }const tagged = new Error(`VideoEncoder.configure failed for ${codecLabel} on both HW and SW: ${swErr?.message || swErr}`,);diff --git a/src/pages/Sandbox/context/ContentState.jsx b/src/pages/Sandbox/context/ContentState.jsxindex dd8bb6e..990d698 100644--- a/src/pages/Sandbox/context/ContentState.jsx+++ b/src/pages/Sandbox/context/ContentState.jsx@@ -269,6 +269,10 @@ const ContentState = (props) => {chrome.storage.local.set({editorReadyAt: Date.now(),editorReadyPath: path,+ // clear the error headline so a bundle grabbed after a recovered load+ // doesn't report a resolved attempt's errCode as the live failure.+ lastRecordingError: null,+ editorRecordingError: null,});} catch {}}, [contentState.ready]);@@ -1195,84 +1199,107 @@ const ContentState = (props) => {lastRecordingBackend: lastRecordingBackendRef?.backend || "idb",}));if (lastRecordingBackendRef?.backend === "opfs") {- const reader = chooseReader(lastRecordingBackendRef);- const readerOpenStart = Date.now();- await reader.open(lastRecordingBackendRef);- diagForward("sandbox-opfs-reader-open-done", {- elapsedMs: Date.now() - readerOpenStart,- fileName: lastRecordingBackendRef?.fileName || null,- });- const readBlobStart = Date.now();- diagForward("sandbox-opfs-readblob-start", {});- const { blob: rawBlob } = await reader.readBlob({- // OPFS file isn't ready yet, recorder still flushing under load.- // Surface a labeled loading state so the user knows it's progressing.- onSlowFinalize: () => {- diagForward("sandbox-opfs-readblob-slow-finalize", {+ // second layer over the reader's finalize-wait: retry a truncated or+ // transient read so a recoverable first open doesn't hit the modal.+ const MAX_OPFS_READ_ATTEMPTS = 3;+ for (let attempt = 1; attempt <= MAX_OPFS_READ_ATTEMPTS; attempt += 1) {+ try {+ const reader = chooseReader(lastRecordingBackendRef);+ const readerOpenStart = Date.now();+ await reader.open(lastRecordingBackendRef);+ diagForward("sandbox-opfs-reader-open-done", {+ elapsedMs: Date.now() - readerOpenStart,+ fileName: lastRecordingBackendRef?.fileName || null,+ attempt,+ });+ const readBlobStart = Date.now();+ diagForward("sandbox-opfs-readblob-start", { attempt });+ const { blob: rawBlob } = await reader.readBlob({+ // OPFS file isn't ready yet, recorder still flushing under load.+ // Surface a labeled loading state so the user knows it's progressing.+ onSlowFinalize: () => {+ diagForward("sandbox-opfs-readblob-slow-finalize", {+ elapsedMs: Date.now() - readBlobStart,+ });+ setContentState((prev) =>+ prev.finalizingRecording ? prev : { ...prev, finalizingRecording: true },+ );+ },+ });+ diagForward("sandbox-opfs-readblob-done", {elapsedMs: Date.now() - readBlobStart,+ rawBlobBytes: rawBlob?.size ?? 0,+ attempt,+ });+ await reader.close().catch(() => {});+ if (!rawBlob) throw new Error("opfs-readblob-empty");+ // OPFS Blob on the critical path; arrayBuffer copy was 30-60s+ // on slow disks for 100MB+ ("stuck at 90%"). Materialize in+ // the background.+ const blob = rawBlob;+ diagForward("sandbox-opfs-materialize-deferred", {+ bytes: rawBlob.size,+ });+ // Fire-and-forget materialize. Swaps in once done; the video+ // element keeps the original src so playback isn't disrupted.+ if (rawBlob.size <= 1_500_000_000) {+ const materializeStart = Date.now();+ (async () => {+ try {+ const buf = await rawBlob.arrayBuffer();+ const materialized = new Blob([buf], {+ type: rawBlob.type || "video/mp4",+ });+ diagForward("sandbox-opfs-materialize-done", {+ elapsedMs: Date.now() - materializeStart,+ outputBytes: materialized.size,+ });+ setContentState((prev) => ({+ ...prev,+ blob: materialized,+ rawBlob: prev.rawBlob || materialized,+ }));+ } catch (err) {+ diagForward("sandbox-opfs-materialize-fail", {+ elapsedMs: Date.now() - materializeStart,+ err: String(err?.message || err).slice(0, 200),+ });+ }+ })();+ }+ directBlob = blob;+ diagForward("sandbox-opfs-direct-read", {+ outputBytes: blob.size,+ attempt,+ });+ if (process.env.SCREENITY_DEV_MODE === "true") {+ console.log("[recorder-opfs][sandbox] opfs-direct-read-ok", {+ bytes: blob.size,+ });+ }+ break;+ } catch (err) {+ diagForward("sandbox-opfs-direct-read-fail", {+ attempt,+ err: String(err?.message || err).slice(0, 200),});- setContentState((prev) =>- prev.finalizingRecording ? prev : { ...prev, finalizingRecording: true },+ console.warn(+ "[Screenity][Sandbox] OPFS direct read failed",+ { attempt, err },);- },- });- diagForward("sandbox-opfs-readblob-done", {- elapsedMs: Date.now() - readBlobStart,- rawBlobBytes: rawBlob?.size ?? 0,- });+ if (attempt < MAX_OPFS_READ_ATTEMPTS) {+ setContentState((prev) =>+ prev.finalizingRecording ? prev : { ...prev, finalizingRecording: true },+ );+ await new Promise((r) => setTimeout(r, attempt * 750));+ continue;+ }+ opfsReadFailed = true;+ }+ }setContentState((prev) =>prev.finalizingRecording ? { ...prev, finalizingRecording: false } : prev,);- await reader.close().catch(() => {});- // OPFS Blob on the critical path; arrayBuffer copy was 30-60s- // on slow disks for 100MB+ ("stuck at 90%"). Materialize in- // the background.- const blob = rawBlob;- if (rawBlob) {- diagForward("sandbox-opfs-materialize-deferred", {- bytes: rawBlob.size,- });- // Fire-and-forget materialize. Swaps in once done; the video- // element keeps the original src so playback isn't disrupted.- if (rawBlob.size <= 1_500_000_000) {- const materializeStart = Date.now();- (async () => {- try {- const buf = await rawBlob.arrayBuffer();- const materialized = new Blob([buf], {- type: rawBlob.type || "video/mp4",- });- diagForward("sandbox-opfs-materialize-done", {- elapsedMs: Date.now() - materializeStart,- outputBytes: materialized.size,- });- setContentState((prev) => ({- ...prev,- blob: materialized,- rawBlob: prev.rawBlob || materialized,- }));- } catch (err) {- diagForward("sandbox-opfs-materialize-fail", {- elapsedMs: Date.now() - materializeStart,- err: String(err?.message || err).slice(0, 200),- });- }- })();- }- }- if (blob) {- directBlob = blob;- diagForward("sandbox-opfs-direct-read", {- outputBytes: blob.size,- });- if (process.env.SCREENITY_DEV_MODE === "true") {- console.log("[recorder-opfs][sandbox] opfs-direct-read-ok", {- bytes: blob.size,- });- }- } else {- opfsReadFailed = true;- }}} catch (err) {opfsReadFailed = true;@@ -1302,6 +1329,8 @@ const ContentState = (props) => {}} catch {}if (!directBlob) {+ // release the once-only guard so a later make-video-tab can retry.+ makeVideoCheck.current = false;if (typeof contentStateRef.current?.openModal === "function") {contentStateRef.current.openModal(chrome.i18n.getMessage("opfsLoadErrorTitle"),@@ -1331,7 +1360,11 @@ const ContentState = (props) => {});}}- reconstructVideo(directBlob);+ // skip on opfs failure (no blob, no relayed chunks) or it builds an empty+ // blob; the idb path still needs the call.+ if (directBlob || backendRefForThisLoad?.backend !== "opfs") {+ reconstructVideo(directBlob);+ }// mark ready if duration-fix hangs; don't overwrite an already-fixed webmconst safetyCheck = () => {diff --git a/src/pages/Sandbox/recorderStorage/opfsChunkReader.js b/src/pages/Sandbox/recorderStorage/opfsChunkReader.jsindex 9d75f4f..ec09202 100644--- a/src/pages/Sandbox/recorderStorage/opfsChunkReader.js+++ b/src/pages/Sandbox/recorderStorage/opfsChunkReader.js@@ -9,9 +9,20 @@ export const MIN_VALID_RECORDING_BYTES = 4096;// by a newer recording (which means our writer is gone).const FINALIZE_POLL_INTERVAL_MS = 250;const FINALIZE_HARD_TIMEOUT_MS = 60_000;+// don't give up while a huge file is still flushing past the 60s timeout;+// only stop once growth stalls, capped here.+const FINALIZE_ABSOLUTE_TIMEOUT_MS = 300_000;// don't flash the "finalizing" UI for the common <1s caseconst SLOW_FINALIZE_NOTIFY_MS = 600;+const diagForward = (event, data) => {+ try {+ chrome.runtime+ .sendMessage({ type: "diag-forward", event, data })+ .catch(() => {});+ } catch {}+};+const wait = (ms) => new Promise((r) => setTimeout(r, ms));export class OpfsChunkReader {@@ -50,7 +61,27 @@ export class OpfsChunkReader {throw new Error("opfs-chunk-reader-not-opened");}const dir = await navigator.storage.getDirectory();- const handle = await dir.getFileHandle(this._fileName);++ let notified = false;+ const notifySlow = () => {+ if (notified) return;+ notified = true;+ try {+ onSlowFinalize?.();+ } catch {}+ };++ // the writer creates the file before the ref, so a NotFoundError here+ // means it was deleted, not a create race. fail fast instead of polling.+ let handle;+ try {+ handle = await dir.getFileHandle(this._fileName);+ } catch (err) {+ if (err?.name === "NotFoundError") {+ diagForward("sandbox-opfs-handle-missing", { fileName: this._fileName });+ }+ throw err;+ }let { sameFile, finalized } = await this._readRefState();@@ -64,7 +95,6 @@ export class OpfsChunkReader {// and read what's on disk.if (sameFile && !finalized) {const startedAt = Date.now();- let notified = false;let timedOut = false;let lastSize = -1;let sizeStableSince = 0;@@ -72,15 +102,20 @@ export class OpfsChunkReader {const SIZE_STABLE_MIN_WAIT_MS = 1500;let writerDead = false;while (true) {- if (Date.now() - startedAt > FINALIZE_HARD_TIMEOUT_MS) {+ const elapsed = Date.now() - startedAt;+ // only time out once the size stops changing; a still-growing file+ // keeps waiting up to the ceiling.+ const growthStalled =+ sizeStableSince > 0 && Date.now() - sizeStableSince >= SIZE_STABLE_MS;+ if (+ elapsed > FINALIZE_HARD_TIMEOUT_MS &&+ (growthStalled || elapsed > FINALIZE_ABSOLUTE_TIMEOUT_MS)+ ) {timedOut = true;break;}- if (!notified && Date.now() - startedAt > SLOW_FINALIZE_NOTIFY_MS) {- try {- onSlowFinalize?.();- } catch {}- notified = true;+ if (!notified && elapsed > SLOW_FINALIZE_NOTIFY_MS) {+ notifySlow();}await wait(FINALIZE_POLL_INTERVAL_MS);({ sameFile, finalized } = await this._readRefState());diff --git a/src/pages/utils/buildDiagnosticZip.js b/src/pages/utils/buildDiagnosticZip.jsindex db155ac..2807a5c 100644--- a/src/pages/utils/buildDiagnosticZip.js+++ b/src/pages/utils/buildDiagnosticZip.js@@ -70,6 +70,7 @@ const FAST_RECORDER_KEYS = ["lastStartRecordingCaller","lastCountdownFinishedDecision","lastStartAfterCountdown",+ "lastSubscriptionLoss",];export const buildDiagnosticZip = async ({diff --git a/src/pages/utils/diagnosticLog.js b/src/pages/utils/diagnosticLog.jsindex fd08792..002739a 100644--- a/src/pages/utils/diagnosticLog.js+++ b/src/pages/utils/diagnosticLog.js@@ -190,6 +190,7 @@ export const getErrorSnapshot = async () => {"lastRecorderStopAt","lastTrackEndEvent","lastTrackEndedEvent",+ "lastSubscriptionLoss",];try {return await chrome.storage.local.get(keys);diff --git a/src/pages/utils/errorCodes.js b/src/pages/utils/errorCodes.jsindex 4a4dadc..2cadc9c 100644--- a/src/pages/utils/errorCodes.js+++ b/src/pages/utils/errorCodes.js@@ -61,11 +61,23 @@ const STREAM_PATTERNS = ["no streams to record","no screen video track","no camera video track",+ "no video data","notreadableerror","notfounderror","overconstrainederror",];+const MEMORY_PATTERNS = [+ "memory",+ "quota",+ "indexeddb",+ "local storage is blocked",+ "local buffer",+ "browser storage",+ "out of storage",+ "free up disk",+];+const CODEC_PATTERNS = ["mediarecorder","webcodecs",@@ -74,6 +86,8 @@ const CODEC_PATTERNS = ["mimeType","mime type","recording error:",+ "video encoder",+ "audio encoder",];const TAB_PATTERNS = [@@ -155,13 +169,7 @@ export const classifyError = (errorStr = "", errorType = "") => {return REC_START_TAB;}- if (- lower.includes("memory") ||- lower.includes("quota") ||- lower.includes("indexeddb") ||- lower.includes("local storage is blocked") ||- lower.includes("local buffer")- ) {+ if (MEMORY_PATTERNS.some((p) => lower.includes(p))) {return REC_RUN_MEMORY;}@@ -171,7 +179,18 @@ export const classifyError = (errorStr = "", errorType = "") => {return REC_START_STREAM;}- return UNKNOWN;+ // never a bare UNKNOWN: tag with the caller's errorType so it still names+ // the subsystem (e.g. UNKNOWN_STREAM_ERROR).+ return qualifyUnknown(errorType);+};++const qualifyUnknown = (errorType) => {+ const tag = String(errorType || "")+ .trim()+ .toUpperCase()+ .replace(/[^A-Z0-9]+/g, "_")+ .replace(/^_+|_+$/g, "");+ return tag ? `${UNKNOWN}_${tag}` : UNKNOWN;};export const makeRecordingAttemptId = () => {diff --git a/src/pages/utils/triggerSupportDownload.js b/src/pages/utils/triggerSupportDownload.jsindex 5da2282..6771a5b 100644--- a/src/pages/utils/triggerSupportDownload.js+++ b/src/pages/utils/triggerSupportDownload.js@@ -4,6 +4,13 @@ import { buildDiagnosticZip } from "./buildDiagnosticZip";// form that opens right after.export const triggerSupportDownload = async (opts = {}) => {try {+ // pro users get a dedicated help form (no zip attachment); skip the+ // background zip download for them.+ const { isLoggedIn, isSubscribed } = await chrome.storage.local.get([+ "isLoggedIn",+ "isSubscribed",+ ]);+ if (isLoggedIn && isSubscribed) return null;const { blob, filename } = await buildDiagnosticZip(opts);const url = URL.createObjectURL(blob);const a = document.createElement("a");