Skip to content

Commit de24fc5

Browse files
committed
feat: add Dia browser support with incognito detection
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.
1 parent 720fa3c commit de24fc5

7 files changed

Lines changed: 67 additions & 2 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ body:
6262
- Arc
6363
- Brave
6464
- Vivaldi
65+
- Dia
6566
- Firefox (experimental)
6667

6768
validations:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ SimplyTrack requires several macOS permissions to function properly:
8383

8484
1. **Automation Permission**: To track browser activity
8585
- System Preferences → Privacy & Security → Automation
86-
- Enable SimplyTrack for your browsers (Safari, Chrome, Edge, Arc, Brave, Vivaldi, Firefox)
86+
- Enable SimplyTrack for your browsers (Safari, Chrome, Edge, Arc, Brave, Vivaldi, Dia, Firefox)
8787

8888
2. **System Events Permission**: For Safari and Firefox browser integration
8989
- System Preferences → Privacy & Security → Automation

SimplyTrack/Managers/PermissionManager.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class PermissionManager: ObservableObject {
4343
"company.thebrowser.Browser",
4444
"com.brave.Browser",
4545
"com.vivaldi.Vivaldi",
46+
"company.thebrowser.dia",
4647
"org.mozilla.firefox",
4748
]
4849

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
//
2+
// DiaBrowser.swift
3+
// SimplyTrack
4+
//
5+
6+
import Foundation
7+
8+
/// Dia-specific implementation of browser interface.
9+
/// Handles URL detection for the Dia browser by The Browser Company.
10+
/// Dia exposes a custom AppleScript interface with tab and URL support.
11+
class DiaBrowser: BaseBrowser {
12+
13+
init() {
14+
super.init(bundleId: "company.thebrowser.dia", displayName: "Dia")
15+
}
16+
17+
/// Dia-specific AppleScript for URL retrieval
18+
override var currentURLScript: String {
19+
return """
20+
tell application "Dia"
21+
if (count of windows) > 0 then
22+
return URL of active tab of window 1
23+
end if
24+
end tell
25+
"""
26+
}
27+
28+
/// Checks if Dia is currently in incognito mode.
29+
/// Dia doesn't expose a private browsing property in its AppleScript dictionary,
30+
/// so we use the accessibility API to check the window's AXIdentifier which
31+
/// contains "bigIncognitoBrowserWindow" for private windows.
32+
override func isInPrivateBrowsingMode() -> Bool {
33+
let script = """
34+
tell application "System Events"
35+
tell process "Dia"
36+
if (count of windows) > 0 then
37+
return value of attribute "AXIdentifier" of front window
38+
end if
39+
end tell
40+
end tell
41+
"""
42+
43+
let scriptResult = executeAppleScript(script)
44+
45+
guard let identifier = scriptResult.result else {
46+
return false
47+
}
48+
49+
return identifier.contains("Incognito")
50+
}
51+
}

SimplyTrack/Services/WebTrackingService.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// SimplyTrack
44
//
55
// Handles browser integration, AppleScript execution, favicon fetching, and website detection
6-
// Supports Safari, Chrome, Edge, Arc, Brave, Vivaldi, and Firefox through AppleScript communication for website tracking
6+
// Supports Safari, Chrome, Edge, Arc, Brave, Vivaldi, Dia, and Firefox through AppleScript communication for website tracking
77
//
88

99
import AppKit
@@ -63,6 +63,7 @@ class WebTrackingService {
6363
ArcBrowser(),
6464
BraveBrowser(),
6565
VivaldiBrowser(),
66+
DiaBrowser(),
6667
FirefoxBrowser(),
6768
].reduce(into: [:]) { result, browser in
6869
result[browser.bundleId] = browser

SimplyTrack/SimplyTrack.entitlements

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<string>company.thebrowser.Browser</string>
1313
<string>com.brave.Browser</string>
1414
<string>com.vivaldi.Vivaldi</string>
15+
<string>company.thebrowser.dia</string>
1516
<string>org.mozilla.firefox</string>
1617
<string>com.apple.systemevents</string>
1718
</array>

SimplyTrack/Views/Settings/PrivacySettingsView.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ struct PrivacySettingsView: View {
101101
.foregroundColor(.secondary)
102102
}
103103

104+
HStack {
105+
Image(systemName: "checkmark.circle.fill")
106+
.foregroundColor(.green)
107+
Text("Dia Incognito")
108+
Spacer()
109+
Text("Supported")
110+
.font(.caption)
111+
.foregroundColor(.secondary)
112+
}
113+
104114
HStack {
105115
Image(systemName: "checkmark.circle.fill")
106116
.foregroundColor(.green)

0 commit comments

Comments
 (0)