Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,9 @@ function browsersWithBuckets(browserbuckets: string[]): [string, string][] {
// See: test/unit/queries.test.node.ts, https://github.com/ActivityWatch/aw-webui/issues/749
export const browser_appname_regex: Record<string, string> = {
chrome: '(?i)^(google[-_ ]?chrome|chrome|chromium)',
firefox: '(?i)(firefox|librewolf|waterfox|nightly)',
// Zen Browser installs the Firefox WebExtension build and can report into
// aw-watcher-web-firefox buckets, so match it as Firefox-compatible too.
firefox: '(?i)(firefox|librewolf|waterfox|nightly|zen)',
opera: '(?i)(opera)',
brave: '(?i)(brave)',
edge: '(?i)^(microsoft[-_ ]?edge|msedge)',
Expand Down
6 changes: 6 additions & 0 deletions test/unit/queries.test.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ describe('browser_appname_regex', () => {
}
});

test('firefox pattern matches Zen when it reports to a Firefox web watcher bucket', () => {
const re = toRegex(browser_appname_regex.firefox);
expect(re.test('Zen')).toBe(true);
expect(re.test('Zen Browser')).toBe(true);
});

test('opera pattern matches all known Opera app names', () => {
const re = toRegex(browser_appname_regex.opera);
const knownNames = ['opera.exe', 'Opera.exe', 'Opera'];
Expand Down