Skip to content

Web apps Tier 2: browser extension for real tab-URL detection #90

Description

@jonocodes

Context

deckd now supports web-app layouts via window-title matching (title:GLOB tokens — see layouts/youtube.yaml, layouts/netflix.yaml and the web-app docs). That's "Tier 1": it works, but rests on a heuristic because desktop focus backends can only see the browser's window title, never the active tab's URL.

Known limitations of the title-only approach

  1. title ≠ URL — a site is only matchable if its name happens to appear in the <title>. GitHub was dropped as an example layout for exactly this reason (its title is ... · GitHub, but many pages don't include a stable token). Domain matching would be reliable.
  2. No sub-page routing — can't distinguish a GitHub issue page from a repo page, or a Gmail inbox from a compose window. The URL path carries this; the title often doesn't.
  3. Silent breakage — a title glob breaks the moment a site restyles its <title>, with no error.

Proposed: Tier 2 — browser extension reporting the active tab URL

Mirror the existing focus-pusher pattern (GNOME Shell extension / KWin script → local endpoint → daemon):

  • A WebExtension (single codebase for Firefox + Chrome) that watches the active tab and posts its URL to the daemon.
  • Daemon-side plumbing to merge the URL into AppInfo (new field alongside app_id/wm_class/title).
  • A new match token, e.g. url:github.com/* / url:*.youtube.com/watch*, resolved with the same site-priority ordering as title: in resolve_layout.

Scope notes / open questions

  • Side-loading vs. add-on store submission (Firefox AMO / Chrome Web Store).
  • Security: the extension should report URL only (no page content); daemon endpoint auth.
  • How URL match interacts with the existing title: tier (URL should outrank title).
  • Graceful degradation when the extension isn't installed (fall back to title/app matching — already the case).

Explicitly out of scope

Tier 3 (in-page DOM action primitive / content-script clicks) was considered and scrapped — most useful web-app actions have real keyboard shortcuts, so they need only detection + existing key: actions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions