Closed alanhamlett closed 7 months ago
Did you have an approach in mind for this? I guess it would technically be possible to detect whether an extension is installed by inspecting the filesystem. I am not sure though if this is what you had in mind since this could bring up technical challenges and privacy concerns. macOS might also show a warning when we try to access certain folders on the filesystem (but I didn't try yet).
There are multiple solutions that I could think of, but they come with different caveats:
Have the WakaTime extensions communicate with the macos-wakatime process via some IPC mechanism (might be a lot of work).
Implement a way for the macOS app to query the wakatime API for active usage of the extensions.
Just put a warning somewhere in the UI and show it regardless of whether the extension is installed.
Monitor the browser's extension folders (with the caveats from above).
I will move to the next issue for now since I am not sure what implementation you'd prefer and this may potentially be a lot of work.
I like option 2 the best. We already have the API for it: https://wakatime.com/developers/#user_agents
Just look for any user agents with last_seen_at
within the last 5 minutes and is_browser_extension
set to true
. Also filter by name
matching enabled browsers so we don't show the warning to people using macos-wakatime to track Firefox but not Chrome, and only have the browser extension installed in Chrome not Firefox.
If Chrome/Safari/Firefox is enabled for monitoring and the dev also has the browser WakaTime extension installed, we should warn them to choose one or the other not both. Either the Mac app or browser extension, but not both.