Review finding
The prompter popout helper builds URLs with string replacement and opens a _blank window without explicit opener isolation.
Evidence
src/system/presenter/prompter-window.ts:15 uses baseUrl.includes('mode=') and baseUrl.replace(/mode=[^&]*/, 'mode=prompter') instead of URL parsing.
src/system/presenter/prompter-window.ts:17 appends &mode=prompter to any string containing ?, which places the mode parameter after #fragment for hash URLs.
src/system/presenter/prompter-window.ts:32 calls window.open(url, '_blank', features) with default features that omit noopener,noreferrer.
Impact
URLs with query values that contain mode= can be corrupted, and hash URLs may not actually enter prompter mode. If an external URL ever flows through this exported helper, the opened page can retain window.opener access unless the browser applies stronger defaults.
Recommended fix
Use the platform URL API and explicit opener isolation.
Acceptance checks
- Build the prompter URL with
new URL(baseUrl, window.location.href) and searchParams.set('mode', 'prompter').
- Preserve hashes and unrelated query parameters.
- Restrict or normalize to same-origin unless a future requirement explicitly allows external prompter targets.
- Add
noopener,noreferrer to the feature string and defensively null opened.opener where possible.
- Tests cover existing
mode, a query value containing mode=, hash URLs, relative URLs, and absolute same-origin URLs.
Review finding
The prompter popout helper builds URLs with string replacement and opens a
_blankwindow without explicit opener isolation.Evidence
src/system/presenter/prompter-window.ts:15usesbaseUrl.includes('mode=')andbaseUrl.replace(/mode=[^&]*/, 'mode=prompter')instead of URL parsing.src/system/presenter/prompter-window.ts:17appends&mode=prompterto any string containing?, which places the mode parameter after#fragmentfor hash URLs.src/system/presenter/prompter-window.ts:32callswindow.open(url, '_blank', features)with default features that omitnoopener,noreferrer.Impact
URLs with query values that contain
mode=can be corrupted, and hash URLs may not actually enter prompter mode. If an external URL ever flows through this exported helper, the opened page can retainwindow.openeraccess unless the browser applies stronger defaults.Recommended fix
Use the platform URL API and explicit opener isolation.
Acceptance checks
new URL(baseUrl, window.location.href)andsearchParams.set('mode', 'prompter').noopener,noreferrerto the feature string and defensively nullopened.openerwhere possible.mode, a query value containingmode=, hash URLs, relative URLs, and absolute same-origin URLs.