feat: add Dia browser support with incognito detection#74
Conversation
Add website tracking support for the Dia browser (by The Browser Company). Detect private/incognito mode using the accessibility API's AXIdentifier attribute, which contains "bigIncognitoBrowserWindow" for private windows. Add Dia to the Privacy settings browser support list.
d464732 to
de24fc5
Compare
|
/prerelease |
|
Prerelease |
|
Hello, thanks for the contribution! Could you also test the newly implemented feature with signed prerelease? |
|
Thanks @renjfk , I tested it and found an issue is actually bigger than Dia! it also affects Safari private browsing detection. The root cause is error code -25211 ("not allowed assistive access") which wasn't being handled. I tested with both the pre-release and stable versions: Safari and Dia Private windows were being tracked in both. The app never prompts for Accessibility permission, and without it, any System Events-based detection silently fails. I'll soon updated the PR to:
After granting Accessibility, both Dia incognito and Safari Private are correctly excluded (tested on release build on local). I'll push the updated changes and we can test with a signed pre-release. So the flow is:
|
…ction
The pre-release and stable builds lacked Accessibility permission,
causing private browsing detection to silently fail for Safari, Firefox,
and Dia. Error code -25211 ("not allowed assistive access") was not
handled, so isInPrivateBrowsingMode() returned false and private windows
were tracked.
- Add -25211 error handling in DiaBrowser, SafariBrowser, and FirefoxBrowser
- Add AXIsProcessTrustedWithOptions prompt at app launch to request
Accessibility permission on first run
- Add logger and proper permission reporting to DiaBrowser
|
/prerelease |
|
Prerelease |
|
/prerelease |
|
Prerelease |
|
@renjfk tested on the new pre-release and it works fine. |
renjfk
left a comment
There was a problem hiding this comment.
Awesome, thanks for the contribution.
Summary
AXIdentifierattributeImportant: New Permission Requirement
This PR requires Accessibility access (System Preferences → Privacy & Security → Accessibility).
Dia's AppleScript dictionary (
Dia.sdef) does not expose anincognitoormodeproperty on windows (unlike Arc/Chrome). The only way to detect private browsing is through the macOS Accessibility API (System Events→AXIdentifier), which requires the app to be granted Accessibility permission. Without this, incognito detection for Dia will always returnfalse.Implementation Details
We use the System Events accessibility API to read the
AXIdentifierof the front window:bigBrowserWindow_<UUID>bigIncognitoBrowserWindow_<UUID>Evidence
URL Retrieval (Dia AppleScript)
Incognito Detection (Accessibility API)
Tested with 4 windows open (2 profiles x 2 modes):
Confirming no native AppleScript property exists
Test Plan