aw-watcher-web
aw-watcher-web copied to clipboard
Firefox watcher not logging data
Hello, I installed Activity Watcher today on Ubuntu 18.04 with Firefox 66.0.3. Thank you very much for making this software.
I added the firefox web watcher a few hours ago, but there is no data in the aw-watcher-web-firefox bucket. aw-watcher-window bucket is logging Firefox window titles fine. Might the problem be that I clear firefox Data (including cache) and History daily?
I added the firefox web watcher a few hours ago, but there is no data in the aw-watcher-web-firefox bucket.
So the bucket is created but there is no data in it, correct? Are you looking in the "Activity" tab or in the "Raw Data" tab? If there is not even any data inside the bucket in "Raw Data" you should find the aw-server log file or debug the firefox addon as there is an issue in one of them but not sure which. How to debug addons on firefox you can Google and the aw-server log relies in ~/.cache/activitywatch/aw-server on Linux.
Might the problem be that I clear firefox Data (including cache) and History daily?
That doesn't matter, aw-watcher-web does not look at the browsers built-in history but as long as the extension is enabled it will track every website you visit similar to the browser history. The reason why we essentially create yet another history is because the built-in browser history does not include the duration the user visited the site which is very important for ActivityWatch to be an useful tool.
So the bucket is created but there is no data in it, correct? Are you looking in the "Activity" tab or in the "Raw Data" tab?
Correct. I am looking in the "Raw Data" tab.
The aw-server log file does not receive a "heartbeat" from Firefox, so there is no
Received heartbeat, but bucket was previously empty, inserting as new event. (bucket: aw-watcher-web-firefox)
in the 3 log files currently generated.
Also, I noticed the Firefox addon display 'Running: checked' but its 'Last sync: never'. Below is output from the debug console.
Setting up client app.js:1806:5
testing: false app.js:1810:7
error occurred while processing 'sources: TypeError: can't access dead object
Stack: createSourceActor@resource://devtools/server/actors/utils/TabSources.js:240:5
onSources@resource://devtools/server/actors/thread.js:1238:7
onPacket@resource://devtools/server/main.js:1286:15
receiveMessage@resource://devtools/shared/transport/child-transport.js:66:5
Line: 240, column: 5 main.js:1155
_unknownError resource://devtools/server/main.js:1155
onPacket resource://devtools/server/main.js:1289
receiveMessage resource://devtools/shared/transport/child-transport.js:66
sources: TypeError: can't access dead object
Aha. It's most likely that for some reason your browser is quick at dropping the info about the tabs which aw-watcher-web has a reference to.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Dead_object
Maybe we could fix this by simply cloning the object, not sure though.
I'll be happy to give it a try. How would I clone the object?
May I ask of the tested Firefox's privacy preferences? Changed mine from 'strict' to 'standard', restarted my machine and no difference is seen.
Watcher is still not working and I haven't figured out how to clone the object. May you please help me?
I have had a similar issue now actually, but it did not occur at all at when I expected it to.
I was testing the aw-server-rust server instead of the standard aw-server-python server and that responded with another response than aw-server-python which aw-watcher-web did not expect. Things did still work as expected but I got the same constant "sources: TypeError: can't access dead object" error message.
What version of activitywatch are you running? I assume that you are not running aw-server-rust?
If you have the time to debug, please try out the aw-watcher-web branch in #33 and look at the console, should hopefully provide better error messages
I'll close this, have not seen the issue in a very long time.
A user on the forum reported that this might be because of a setting in firefox
https://forum.activitywatch.net/t/unable-to-connect-to-server-with-aw-watcher-web-firefox
This should be documented!
The setting comes from setting Firefox to never remember history:
When set, no connection is made to the aw-server
I have a similar issue, and does not set "never remember history".
The browser extension says it was "last synced" 4 days ago (2023/4/7 17:37:36
), though the bucket in AW is empty.
The most recent log file (3 days ago) does not have aw-watcher-web-firefox
. For all log files, only 3 of them has. Most recent one is (aw-server_2023-04-02T18-20-19.log
):
2023-04-07 16:40:23 [INFO ]: Received heartbeat after pulse window, inserting as new event. (bucket: aw-watcher-web-firefox) (aw_server.api:279)
I'm on Linux and currently on Wayland, so currently no browsing history is recorded at all... But I can confirm AW is working as I do have some logs (probably applications using XWayland); previously on X11 AW was working fine.
My previous attempt (2 months ago) with Firefox Developer Edition with custom build of the extension also had no data. I thought it was because of custom build, but now it looks like it's not.