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

Browser activity not showing in Activity view #102

Open
sbstratos79 opened this issue Jan 27, 2023 · 2 comments
Open

Browser activity not showing in Activity view #102

sbstratos79 opened this issue Jan 27, 2023 · 2 comments

Comments

@sbstratos79
Copy link

sbstratos79 commented Jan 27, 2023

Raw data view has all the browser activity, but it doesn't show in the Browser tab in Activity view.
My issue is very similar to #67 except for the fact that I am not using Wayland. I am using Xorg and still facing this issue.

Librewolf 109.0, EndeavourOS.

@edobez
Copy link

edobez commented Sep 29, 2023

I have the same problem on Vivaldi (using Chrome extension) on Windows.
Data is collected under "unknown" hostname and I can see that the bucket name misses the host name as suffix.

@marcinsmialek
Copy link

marcinsmialek commented Mar 4, 2024

It can happen for many browsers - they may get recognized as different browser or there will be no matching rules in aw-webui

In case of Vivaldi, it's because Vivaldi is recognized as Chrome after they changed user agent to look like Chrome, not to be treated as second class citizen.

Reference:
https://vivaldi.com/blog/vivaldi-on-desktop-6-1/
https://help.vivaldi.com/desktop/miscellaneous/user-agent-brand-masking/
https://vivaldi.com/blog/user-agent-changes/

My current Vivaldi user agent string:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36

The browser name is read as chrome
https://github.com/ActivityWatch/aw-watcher-web/blob/master/src/client.js#L27-L28

The bucket is named aw-watcher-web-chrome (without hostname), and not aw-watcher-web-vivaldi
ActivityWatch tries to match web bucket events with active window events. For VIvaldi users, it'll find neither aw-watcher-web-vivaldi bucket nor chrome.exe window events.
https://github.com/ActivityWatch/aw-webui/blob/master/src/queries.ts#L284
https://github.com/ActivityWatch/aw-webui/blob/master/src/queries.ts#L303

Here's how browser extension can check if it's running on Vivaldi or Chrome
https://stackoverflow.com/questions/68659729/how-to-detect-clients-web-browser-is-vivaldi/77047611#77047611

I'm afraid that we'd need such extra check or a configuration field, so user can manually set the browser name rather than rely on the auto detection.
Manual setup looks the most promising, because it's flexible and people running niche browsers should be used to extra configuration steps.

Another solution would be to modify aw-webui web-window matching to treat Chrome-like browsers as Chrome, Firefox-like as Firefox and extend the execs list.
Or better, add config in base ActivityWatch rather than web extensions. Just now from the regular user's point of view, the browser list is hardcoded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants