Skip to content

Commit 7aefd13

Browse files
committed
Fix: guard screen access for service worker context
The background.js service worker does not have access to the window screen object. Accessing screen.width threw a ReferenceError which silently prevented startSession() from completing and blocked all annotation saves. Added typeof screen !== 'undefined' guard so screenResolution falls back to 'N/A' when running in service worker context. https://claude.ai/code/session_013y1QH2gkj8wg427JpzjdJe
1 parent 0faa8df commit 7aefd13

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/browserInfo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export async function getSystemInfo() {
4444
browserVersion,
4545
os,
4646
osVersion,
47-
screenResolution: `${screen.width} × ${screen.height}`,
47+
screenResolution: (typeof screen !== 'undefined' && screen.width) ? `${screen.width} × ${screen.height}` : 'N/A',
4848
language: navigator.language,
4949
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
5050
cookies: navigator.cookieEnabled

0 commit comments

Comments
 (0)