ActivityWatch / aw-watcher-web

Browser watcher for ActivityWatch
Mozilla Public License 2.0
329 stars 47 forks source link

Firefox data is not shown in visualizations #107

Open da-the-dev opened 1 year ago

da-the-dev commented 1 year ago

I can see aw-watcher-web-firefox bucket in the timeline and in the raw data tab, but "Top Browser Domains" and "Top Browser URLs" visualizations show that there's no data. Browser extension says that it's connected to the server. I'm on Fedora 37 if it helps.

da-the-dev commented 1 year ago

I did look through the bug reports, found #32, but that seems to be not the issue that I have. Maybe they are related, though I'm not sure.

pi314ever commented 1 year ago

I'm having this issue as well, it seems to work again if you disable then enable again in the extension menu (not in the firefox preferences)

da-the-dev commented 1 year ago

I'm having this issue as well, it seems to work again if you disable then enable again in the extension menu (not in the firefox preferences)

Hm, I toggled the checkbox off and then on, but the issue still persists. Could you describe what you did in a bit more detail? Maybe I'm missing some step.

harshkhandeparkar commented 1 year ago

I have the same issue aw version 0.12.2 extension version 0.4.7 I'm on Arch

hornhaut commented 1 year ago

Same issue and I can reproduce @pi314ever 's solution. Seems like the extensions for some reason does not start properly when starting Firefox. I'm on Windows, both activity watch and the Firefox extension are up-to-date. @da-the-dev I just clicked on the aw extensions icon on the search bar (or in the extension menu in the search bar) and then there is a checkbox behind "Enabled" which I toggled (to disable the extension). Then I clicked somewhere else to close the pop-up and opened it again to toggle the checkbox again.

algers commented 1 year ago

I've discovered a temporary solution that allows logging and synchronization by reloading the extension within the "Inspect" developer tools window while debugging is activated. It seems that when the extension is loaded in the typical manner, it doesn't properly integrate with the browser and fails to operate in the background.

Workaround steps:

  1. Open a new tab and enter about:debugging in the address bar.
  2. In the sidebar, click on "This Firefox".
  3. Scroll down to find "ActivityWatch" in the extension list.
  4. Click "Inspect" to open the extension's developer tools window.
  5. In the header bar of this window, click the reload icon to refresh the extension.

image

Aziks0 commented 1 year ago

The background script is not executed on browser startup because persistent is set to false.

https://github.com/ActivityWatch/aw-watcher-web/blob/b53d09997e97261e3246d1e225d12b4e4b85dd6f/manifest.json#L28

persistent: true is also the default behavior when unset. And I don't know of any extension that uses persistent: false.


For reference:

https://github.com/Cookie-AutoDelete/Cookie-AutoDelete/blob/ca628ccfa567eeb5e088c74812090659185132b2/extension/manifest.json#L2-L11 https://github.com/darkreader/darkreader/blob/6723337369f784468c28f1d757c46227255693aa/src/manifest.json#L22 https://github.com/darkreader/darkreader/blob/6723337369f784468c28f1d757c46227255693aa/src/manifest-firefox.json#L8-L10C2 https://github.com/ClearURLs/Addon/blob/14a0832973e137f0cbbbb1e9110c1286bc88e319/manifest.json#L57-L74 https://github.com/ajayyy/SponsorBlock/blob/b07381e5d0bae8cea21af7054f7a6464c889a6d4/manifest/manifest.json#L121-L125 https://github.com/gorhill/uBlock/blob/5ba3055bc77cf99ff20d5d29da53fc78b6b6e9e0/platform/firefox/manifest.json#L3-L5

ErikBjare commented 1 year ago

I releases v0.4.8 with a possible fix this morning, it has been published on Mozilla Addons: https://github.com/ActivityWatch/aw-watcher-web/releases/tag/v0.4.8

Plrease report any continued issues you experience.

harshkhandeparkar commented 1 year ago

I releases v0.4.8 with a possible fix this morning, it has been published on Mozilla Addons: https://github.com/ActivityWatch/aw-watcher-web/releases/tag/v0.4.8

Plrease report any continued issues you experience.

This doesn't fix it. I would like to mention that there is data in the bucket but it isn't displayed in the visualizations. (I'm on Wayland but the hostname for the bucket does match my hostname) image image

ErikBjare commented 1 year ago

@harshkhandeparkar What is the appname for Firefox for you? (under "Top Applications")

harshkhandeparkar commented 1 year ago

@harshkhandeparkar What is the appname for Firefox for you? (under "Top Applications")

It is unknown :(

hornhaut commented 1 year ago

I releases v0.4.8 with a possible fix this morning, it has been published on Mozilla Addons: https://github.com/ActivityWatch/aw-watcher-web/releases/tag/v0.4.8

Plrease report any continued issues you experience.

I had to give consent to the collection of offline data again, but now it seems to work :) (still, I will check it regularly the next days to make sure it works reliably)

Thanks for the fix!

myrrc commented 1 year ago

@harshkhandeparkar What is the appname for Firefox for you? (under "Top Applications")

firefox-esr-esr102 as for me, also empty browser view.

dmusican commented 1 year ago

I just found this issue after having the same problem. I'm running Firefox 116.0.3, under Ubuntu 22.04. It will only record data if I disable the add-on, then re-enable it, when I start Firefox. I'm running add-on version 0.4.8.

jonas-w commented 1 year ago

For me the information shows in the timeline view and when looking at the Bucket directly. But not in the "Activity" tab. Could it be a problem, that I use "Librewolf" instead of "Firefox"? Also the hostname for the web watcher bucket is "unknown"

MathieuDR commented 1 year ago

For me the information shows in the timeline view and when looking at the Bucket directly. But not in the "Activity" tab. Could it be a problem, that I use "Librewolf" instead of "Firefox"? Also the hostname for the web watcher bucket is "unknown"

Same here for me on Floorp. Also Unknown hostname and no browser data. The bucket however is syncing.

jiriks74 commented 11 months ago

Hello, I just installed ActivityWatcher and I'm experiencing the same issue. I'm on Arch, running KDE on Wayland and Firefox is installed through Flatpak

TschuttGR commented 11 months ago

For me the information shows in the timeline view and when looking at the Bucket directly. But not in the "Activity" tab. Could it be a problem, that I use "Librewolf" instead of "Firefox"? Also the hostname for the web watcher bucket is "unknown"

Same here for me on Librewolf using MacOS 12.

@harshkhandeparkar What is the appname for Firefox for you? (under "Top Applications")

Here I get "LibreWolf".

heddxh commented 10 months ago

I am on Arch Linux Kde plasma firefox, and the plugin report my devices as "unknown"

SettingDust commented 9 months ago

What could be the reason for this? I'm facing this on Windows with Floorp. There is raw data but no visualizations The process is floorp.exe

Is it related to https://github.com/ActivityWatch/aw-webui/pull/111/files?

EDIT: Ah. It is fine after adding floorp to the list. 图片

DivineMK commented 7 months ago

I hope this issue of browser not supported by the default should be documented somewhere so newcomers who use non-traditional browsers like forks are not steered away from the fact that ActivityWatch don't work right away. @ErikBjare

francissjr commented 6 months ago

Here I still have the problem, without the firefox monitoring data. The algers solution works as a stopgap.

Mozilla Firefox (126.0) ActivityWatch Web Watcher 0.4.8 ActivityWatch v0.12.2 Windows 11 Pro 23H2

GitFr33 commented 6 months ago

I have this problem also since Dec 2023. Previous to that date it was working perfectly, after then Firefox is never listed in "Top Applications" and the time spent using it shows as "unknown" in both "Top Application" and "Window Title" lists and "Browser Domains" and "Browser URLs" show "No Data".

ActivityWatch Version: v0.12.2 ActivityWatch Web Watcher 0.4.8 Mozilla Firefox 126.0 Ubuntu 22.04

I have tried reinstalling and restarting the Firefox Plugin, disable the add-on and then re-enabling it, and reloading the extension as suggested by algers.

Going to http://localhost:5600/#/buckets/aw-watcher-web-firefox shows all my Firefox activity accurately up to the moment.

Regarding the comment by SettingDust: I see that the window title for Firefox on my machine is "Firefox Web Browser" which is not in the browser_appnames list for Firefox. Is there a simple way that I can edit this file and see if that helps without having to build ActivityWatch?

SettingDust commented 6 months ago

Is there a simple way that I can edit this file and see if that helps without having to build ActivityWatch?

@GitFr33 You needn't build it since the file in screenshot is the built one. Just search and edit it.

GitFr33 commented 6 months ago

Is there a simple way that I can edit this file and see if that helps without having to build ActivityWatch? @GitFr33 You needn't build it since the file in screenshot is the built one. Just search and edit it.

Right! I've tried adding "Firefox Web Browser" to the list and I'll report back.

GitFr33 commented 6 months ago

Following up on this: adding "Firefox Web Browser" to the list of names for firefox didn't seem to help.

The problem does not exist after switching from wayland to x11. I also noticed that activity for Thunderbird, and the tray icon, are also both not working in wayland but work with x11. Unfortunately, my system is unusably gimpy in x11.

Kellenok commented 4 months ago

@SettingDust Hi, can you tell me which file you changed? What directory was aw_server folder in?

SettingDust commented 4 months ago

@SettingDust Hi, can you tell me which file you changed? What directory was aw_server folder in?

IDK. Depends on your installation path.

For file name. IDK either. It's hash instead of a readable filename. You can try to find the file with the same name in my image or search in the directory with tool like VSCode in the image