Skip to content

Commit b258f05

Browse files
fix(desktop): preview permission prompts default to deny
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 4fd9f98 commit b258f05

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎apps/desktop/src/preview/BrowserSession.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ describe("BrowserSession", () => {
256256
"https://allowed.test wants to see text and images copied to the clipboard",
257257
);
258258
assert.deepStrictEqual(showMessageBox.mock.calls[0]?.[0].buttons, ["Allow", "Block"]);
259+
// Enter must not accept a prompt the page raised while the user was typing.
260+
assert.strictEqual(showMessageBox.mock.calls[0]?.[0].defaultId, 1);
259261

260262
assert.isTrue(yield* readClipboard("https://allowed.test/other"));
261263
assert.isTrue(checkClipboard("https://allowed.test"));

‎apps/desktop/src/preview/BrowserSession.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ export const make = Effect.gen(function* BrowserSessionMake() {
214214
{
215215
type: "question",
216216
buttons: [...prompt.buttons],
217-
defaultId: 0,
217+
// Default to deny so an Enter typed into the page cannot accept a prompt it raised.
218+
defaultId: 1,
218219
cancelId: 1,
219220
message: prompt.message,
220221
...(prompt.detail === undefined ? {} : { detail: prompt.detail }),

0 commit comments

Comments
 (0)