{"record":{"id":"b4db0e887b69c541","repo":"mozilla/pdf.js","slug":"fullscreen-transitions-is-read-only","errorCode":null,"errorMessage":"fullscreen.transitions is read-only","messagePattern":"fullscreen\\.transitions is read-only","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/scripting_api/fullscreen.js","lineNumber":130,"sourceCode":"      \"WipeUp\",\n      \"SplitHorizontalIn\",\n      \"SplitHorizontalOut\",\n      \"SplitVerticalIn\",\n      \"SplitVerticalOut\",\n      \"BlindsHorizontal\",\n      \"BlindsVertical\",\n      \"BoxIn\",\n      \"BoxOut\",\n      \"GlitterRight\",\n      \"GlitterDown\",\n      \"GlitterRightDown\",\n      \"Dissolve\",\n      \"Random\",\n    ];\n  }\n\n  set transitions(_) {\n    throw new Error(\"fullscreen.transitions is read-only\");\n  }\n\n  get usePageTiming() {\n    return this._usePageTiming;\n  }\n\n  set usePageTiming(_) {\n    /* TODO or not */\n  }\n\n  get useTimer() {\n    return this._useTimer;\n  }\n\n  set useTimer(_) {\n    /* TODO or not */\n  }\n}","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/mozilla/pdf.js/blob/5903d58d58e4dd9ce6ffa3834aea8480f06b4ada/src/scripting_api/fullscreen.js#L112-L148","documentation":"Thrown by the setter of `FullScreen.transitions` (src/scripting_api/fullscreen.js:130). The `transitions` property returns a fixed, read-only list of supported page-transition names (per the Acrobat JS spec); PDF.js hard-codes the array and forbids replacing it. Other `FullScreen` setters silently no-op, but `transitions` is the single read-only one.","triggerScenarios":"A presentation script executes `app.fs.transitions = [...];` to constrain allowed transitions, or generic code that writes back a snapshot of every full-screen property.","commonSituations":"Presentation-mode scripts ported from Acrobat that customize the transition whitelist; round-tripping a settings object through serialization.","solutions":["Do not assign `transitions`; read the fixed list to validate user choices instead.","If you need a restricted subset, keep your own array and check membership against the returned list.","Wrap the assignment in try/catch if it comes from code you cannot refactor."],"exampleFix":"// before\napp.fs.transitions = myTransitions;\n// after\nconst allowed = app.fs.transitions; // read-only list\nconst safe = myTransitions.filter(t => allowed.includes(t));","handlingStrategy":"try-catch","validationCode":"const READ_ONLY_FS_PROPS = new Set(['transitions']);\nfunction isWritableFsProp(key) {\n  return !READ_ONLY_FS_PROPS.has(key);\n}","typeGuard":null,"tryCatchPattern":"try {\n  app.fs.transitions = list;\n} catch (e) {\n  // transitions is read-only; filter against the fixed list instead\n  const allowed = app.fs.transitions;\n  const safe = list.filter(t => allowed.includes(t));\n}","preventionTips":["Read app.fs.transitions to obtain the fixed whitelist; never assign it.","Maintain your own subset list and validate membership against the returned array.","Other FullScreen setters are no-ops; only transitions throws, so treat it specially."],"tags":["scripting-api","fullscreen","read-only","acrobat-js"],"backgroundTag":null,"analyzedSha":"5903d58d58e4dd9ce6ffa3834aea8480f06b4ada","analyzedAt":"2026-08-13T02:28:27.364Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}