Skip to content

feat(browser): expand practical site permissions #23

Closed

Description

@trmosala

Problem

Only camera and microphone have configurable site permissions.

Implementation order

Browser backlog item 19 of 29. Phase: Settings and developer features. This is ordered planning, not a claim that Codex implements every item. Items 24–29 are optional additions.

Acceptance criteria

  • Evaluate and implement demanded screen-sharing, notification, clipboard and location permissions using supported APIs.
  • Expose only functioning controls with origin-specific consent, revocation and OS requirements.
  • Test revoked permissions and active capture shutdown; report unsupported platforms.

Dependencies

Engineering and validation

Reuse existing Chromium/Electron/OS facilities where available. Preserve main-process ownership and permission enforcement, add no placeholder controls, use existing i18n patterns, and test behavior with synthetic fixtures. Document platform limitations. Baseline: browser-tabs at 47fef3e; see packages/cm-browser/README.md and password-security.md.

Activity

  1. trmosala commented on Sep 18, 2026

    @trmosala
    OwnerAuthor

    Published the supported notification-permission slice in ced347782.

    Implemented:

    • Capability-gated Block / Ask / Allow controls in Browser Settings and Site, backed by Electron's notification permission handlers in main.
    • Exact HTTPS/loopback origin enforcement plus task, owner, tab, document, selected/visible native view, agent-access and busy-state checks.
    • Default-Cancel native Ask flow with a 30-second bound and final identity/policy revalidation before persisting Allow.
    • Immediate cleanup when another owner persists the policy or layout clips/detaches the native view; late answers cannot revive consent.
    • Partial site-rule updates preserve sibling camera/microphone/notification settings. Legacy rows default notifications to Block; malformed storage fails closed without repair.
    • Documentation for revocation behavior, OS requirements and unsupported categories.

    Final evidence on the published tree:

    • packages/desktop: bun typecheck PASS.
    • packages/app: bun typecheck PASS.
    • Native i18n: 10 tests / 459 assertions PASS.
    • Desktop browser suite: 171 tests / 2,492 assertions PASS.
    • One serial default isolated native smoke PASS on Electron 42.3.3 / Chromium 148.0.7778.218; expected /fail ERR_EMPTY_RESPONSE and Mojo diagnostics were non-fatal.
    • Scoped Prettier and git diff --check PASS.
    • Scoped oxlint: 102 warnings / 0 errors (not warning-free).
    • Final cumulative Standards and Spec source reviews: CLEAR, including the cross-owner and clipped-viewport cleanup fixes and exact restored error text.
    • Normal push hook: 31/31 typecheck tasks PASS. Local and remote branch SHA both ced3477828e6dd72c19c080ee662cb015ef80e96.

    This does not complete the full issue acceptance. The fixture exercises Chromium's permission paths with synthetic native-dialog answers and posts no OS notification. Real delivery/OS consent, packaged Windows, macOS/Linux, native accessibility and reviewed translations remain unverified. Screen sharing, clipboard permission controls and geolocation remain unsupported because the required safe source/lifetime, human-consent and configured service boundaries are not implemented. Notification tests do not prove active screen-capture shutdown. Keeping #23 open for those gates.

  2. trmosala commented on Sep 22, 2026

    @trmosala
    OwnerAuthor

    Validated on macOS arm64 in commit cc308d7. Detailed evidence and limitations.

    Notification permission request/check, origin consent, revocation, stale Ask rejection and corrupt storage fixtures pass. The fixture now waits for native hide before checking invalidation. This issue remains OPEN: screen-sharing source selection/active-capture shutdown are absent, clipboard controls and geolocation remain blocked, and physical OS notification delivery has not been tested. This is partial implementation, not completion of the full acceptance criteria.

  3. trmosala commented on Sep 22, 2026

    @trmosala
    OwnerAuthor

    This was generated by AI during implementation.

    Implemented and validated in 33379b6959.

    • Added exact-origin Block/Ask/Allow controls for notifications, clipboard, and screen sharing on supported macOS builds.
    • Screen sharing uses the macOS 15+ native system picker. Revocation replaces the capturing document locally before restoring history, so a page unload veto, concurrent Stop, or HTTP 204 response cannot keep the stream alive.
    • Clipboard request/check paths preserve the selected visible private main-page boundary and deny agent-controlled or busy tabs.
    • Geolocation remains unavailable because CookieMonster has no approved provider/API key or macOS location usage declaration. No nonfunctional control is exposed. Windows and Linux are outside the CookieMonster release target.

    Validation: native Electron permission smoke passed with a real tab display stream; 257/257 desktop browser tests and 43/43 mounted app browser tests passed; desktop/app typechecks and the push-time 31-package typecheck passed; scoped lint reported zero errors; both independent source reviews were clear. Native i18n passed 14 checks with one pre-existing pa-PK locale-detection failure.

    A branded unsigned macOS .pkg, .dmg, and .zip were built locally. The package replaced /Applications/CookieMonster.app; installed and packaged app.asar hashes matched, the package receipt and installer-owned CLI validated, the app launched, and the WPP bridge health/model roster responded. Signing and notarization were intentionally skipped for this local test build. Physical notification delivery and physical Apple picker interaction remain documented manual acceptance checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions