Watcher for iOS chrome browsing history

If you are logged in to your google account on chrome on a mobile device and have sync turned on, then you can access your browsing history on a computer logged in to the same account. This should allow Activity Watch to capture time spent browsing the Internet on your phone. For me this would be a big win as it would capture a significant chunk of my time that is currently out of view to Activity Watch.

The browser history contains every website you have visited but it lacks the most important data for activitywatch to be useful, the actual time spent on each website.

So that is unfortunately not enough data to implement support for it on iOS.

More details:

I use Google Chrome on my mac and on my iPhone, and I’m logged in in both places with syncing turned on. If I go to “chrome://history/syncedTabs” on my computer I can see what tabs I have open on my phone. I’ve figured out that this data is stored in ~/Library/Application\ Support/Google/Chrome/Profile\ 1/Sync\ Data/LevelDB/
(Probably the path would be ~/Library/Application\ Support/Google/Chrome/Default/Sync\ Data/LevelDB/ for you)
I think by simply reading from this LevelDB database every few minutes (or every time it changes) it should be possible to get an approximate / best-effort watcher for this.
One downside is this might not give visibility into which tab is active, only which tabs are open (even if they’re in the background). I don’t know how to properly parse the data so I can’t be sure the Active Tab info isn’t in there too. Another downside is this strategy is limited by the sync frequency – I don’t know what triggers a sync.

(For what it’s worth, I wrote up what I’ve figured out so far here https://davidbieber.com/snippets/2021-01-01-programmatically-accessing-chromes-tabs-from-other-devices-data/)

1 Like