Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: changed many rules in browser-to-appname map to use case-insensitive regexes #561

Closed
Closed
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
58 changes: 14 additions & 44 deletions src/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,75 +213,45 @@ export function appQuery(
return querystr_to_array(code);
}

// To see actual app names as discovered by users, see older pre-regex commits.
const browser_appnames = {
chrome: [
// Chrome
'Google Chrome',
'Google-chrome',
/google\w?chrome(-beta|-stable|-unstable)?/i,
'chrome.exe',
'google-chrome-stable',

// Chromium
'Chromium',
'Chromium-browser',
'Chromium-browser-chromium',
'chromium.exe',

// Pre-releases
'Google-chrome-beta',
'Google-chrome-unstable',

// Brave (should this be merged with the brave entry?)
'Brave-browser',
/chromium\w?(browser)?(-chromium)?(.exe)?/i,
],
firefox: [
// Firefox
'Firefox',
'Firefox.exe',
'firefox',
'firefox.exe',
/firefox(.exe)?/i,

// Firefox Developer
'Firefox Developer Edition',
'firefoxdeveloperedition',
/firefox\w?developer\w?edition/i,

// Pre-releases https://github.com/ActivityWatch/aw-watcher-web/issues/87
'Firefox-esr',
'Firefox Beta',
/firefox\w?(beta|esr|aurora|trunk-dev)?/i,
'Nightly',
'firefox-aurora',
'firefox-trunk-dev',

// Librewolf
'LibreWolf-Portable.exe',
'LibreWolf',
'LibreWolf.exe',
'Librewolf',
'Librewolf.exe',
'librewolf',
'librewolf.exe',
// Sometimes "librewolf-default" (https://discord.com/channels/755040852727955476/755334543891759194/1237102962241704038)
/LibreWolf(-Portable|-default)?(.exe)?/i,

// Waterfox
'Waterfox',
'Waterfox.exe',
'waterfox',
'waterfox.exe',
/Waterfox(.exe)?/i,
],
opera: ['opera.exe', 'Opera'],
brave: ['brave.exe'],
opera: [/opera(.exe)?/i],
brave: [/brave\w?(browser)?(.exe)?/i],
edge: [
'msedge.exe', // Windows
'Microsoft Edge', // macOS
'Microsoft-Edge-Stable', // Arch Linux: https://github.com/ActivityWatch/activitywatch/issues/753
'Microsoft-edge',
'microsoft-edge', // linux
'microsoft-edge-beta', // linux beta
'microsoft-edge-dev', // linux dev
/microsoft edge/i, // macOS
/microsoft\wedge\w?(stable|beta|dev)?/i, // linux, Arch Linux: https://github.com/ActivityWatch/activitywatch/issues/753
],
arc: [
'Arc', // macOS
],
vivaldi: ['Vivaldi-stable', 'Vivaldi-snapshot', 'vivaldi.exe', 'Vivaldi'],
vivaldi: [/Vivaldi\w?(stable|snapshot)?(.exe)?/i],
orion: ['Orion'],
yandex: ['Yandex'],
};
Expand Down
Loading