Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): stop granting preview content clipboard-read and geolocation #8291

Closedalexandros-lekkas(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/8291/headopened View on GitHub

Showing 2 changed files with 17 additions and 10 deletions.

x
0 of 2 viewed, 2 left
7 additions and 8 deletionsapps/desktop/src/preview/BrowserSession.test.tsModified
View file
@@ -63,7 +63,7 @@
}).pipe(Effect.provide(layer)),
);
​
- it.effect("grants clipboard-sanitized-write through both the request and check handlers", () =>
+ it.effect("grants only write-direction clipboard access through both handlers", () =>
Effect.gen(function* () {
const browserSessions = yield* BrowserSession.BrowserSession;
const partition = yield* browserSessions.getPartition("scope-a");
@@ -86,12 +86,7 @@
return granted;
};
​
- for (const permission of [
- "clipboard-read",
- "clipboard-sanitized-write",
- "notifications",
- "geolocation",
- ]) {
+ for (const permission of ["clipboard-sanitized-write", "notifications"]) {
assert.isTrue(requestAllows(permission), `request handler should allow ${permission}`);
assert.isTrue(
checkHandler(null, permission) as boolean,
@@ -102,7 +97,11 @@
// `clipboard-write` is not a real Electron permission — the async write API
// uses `clipboard-sanitized-write` — so the stale name must not be granted,
// and unrelated permissions stay denied.
- for (const permission of ["clipboard-write", "midi"]) {