aw-watcher-web icon indicating copy to clipboard operation
aw-watcher-web copied to clipboard

Browser activity not showing in Activity view

Open sbstratos79 opened this issue 2 years ago • 3 comments

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.

sbstratos79 avatar Jan 27 '23 10:01 sbstratos79

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.

edobez avatar Sep 29 '23 09:09 edobez

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.

marcinsmialek avatar Mar 04 '24 02:03 marcinsmialek

I am using Brave and have the same issue.

This reply mentions there is a known workaround, what is it?

swapnilraj avatar Aug 18 '24 17:08 swapnilraj