Add Dia browser support for URL-based mode triggers - #835
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,ActiveWindowServiceonly queries the frontmost app for its URL when that app matches a knownBrowserType:Dia wasn't part of the
BrowserTypeenum, so this guard returned early and the URL was never read — no website trigger could ever match while browsing in Dia.Fix
.diacase toBrowserTypewith bundle identifiercompany.thebrowser.dia.VoiceInk/Resources/diaURL.scpt.Dia ships a scripting definition (
Dia.app/Contents/Resources/Dia.sdef) exposing anactive tabproperty onwindowand aURLproperty ontab, so the script mirrors the existing Arc one:Testing
company.thebrowser.dia).xcodebuild -scheme VoiceInk buildsucceeds, anddiaURL.scptis picked up by the synchronized resources group and copied intoVoiceInk.app/Contents/Resources/.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 idcompany.thebrowser.dia) and shipsdiaURL.scptto read the active tab URL.Written for commit bb1b294. Summary will update on new commits.