Skip to content

Add Dia browser support for URL-based mode triggers - #835

Merged
Beingpax merged 1 commit into
Beingpax:mainfrom
2R-2T:feat/dia-browser-url-detection
Jul 24, 2026
Merged

Add Dia browser support for URL-based mode triggers#835
Beingpax merged 1 commit into
Beingpax:mainfrom
2R-2T:feat/dia-browser-url-detection

Conversation

@2R-2T

@2R-2T 2R-2T commented Jul 22, 2026

Copy link
Copy Markdown

Problem

URL-based mode triggers (Email, AI, Messaging…) don't work in Dia, while they work fine in Chrome, Safari, Arc and the other supported browsers.

The Email trigger matches either on an app bundle identifier or on the current page URL (TriggerTemplateCatalog.swift). For the URL path, ActiveWindowService only queries the frontmost app for its URL when that app matches a known BrowserType:

guard let browserType = BrowserType.allCases.first(where: { $0.bundleIdentifier == bundleIdentifier }) else {
    return Task {}
}

Dia wasn't part of the BrowserType enum, so this guard returned early and the URL was never read — no website trigger could ever match while browsing in Dia.

Fix

  • Add a .dia case to BrowserType with bundle identifier company.thebrowser.dia.
  • Add VoiceInk/Resources/diaURL.scpt.

Dia ships a scripting definition (Dia.app/Contents/Resources/Dia.sdef) exposing an active tab property on window and a URL property on tab, so the script mirrors the existing Arc one:

tell application "Dia"
    tell front window
        tell active tab
            return URL
        end tell
    end tell
end tell

Testing

  • Verified the AppleScript returns the active tab URL on Dia (build 2026-07, company.thebrowser.dia).
  • xcodebuild -scheme VoiceInk build succeeds, and diaURL.scpt is picked up by the synchronized resources group and copied into VoiceInk.app/Contents/Resources/.
  • Confirmed a website trigger (e.g. mail.google.com) now activates the corresponding mode while browsing in Dia.

Note: as with every other browser, macOS will prompt for Automation permission for Dia the first time the script runs.


Summary by cubic

Enable URL-based mode triggers in Dia so Email/AI/Messaging modes activate while browsing. Adds Dia to BrowserType (bundle id company.thebrowser.dia) and ships diaURL.scpt to read the active tab URL.

Written for commit bb1b294. Summary will update on new commits.

Review in cubic

Dia was missing from the BrowserType enum, so ActiveWindowService bailed
out before reading the active tab URL whenever Dia was the frontmost app.
As a result, URL-based triggers (Email, AI, etc.) never fired in Dia while
they worked in Chrome, Safari and the other supported browsers.

Add a .dia case (bundle id company.thebrowser.dia) along with the matching
diaURL.scpt AppleScript, which follows the same window/active tab/URL
structure Dia exposes in its scripting definition.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@Beingpax
Beingpax merged commit 50f75d2 into Beingpax:main Jul 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants