wakatime / browser-wakatime

Chrome extension for automatic time tracking and metrics generated from your browsing activity.
https://wakatime.com
BSD 3-Clause "New" or "Revised" License
406 stars 95 forks source link

Showing time on leaderboards #67

Open 3210jr opened 6 years ago

3210jr commented 6 years ago

Hello, It would be nice to log the time spent on browser and display on leaderboard. This will be useful as there are many people using jupyter notebooks EVERYDAY and even spend much of their time playing around with chrome dev tools and online code collaboration tools.

Thanks!

vaibhavhrt commented 6 years ago

I think only time spent on online coding websites like codepen, jsfiddle, repl.it etc tracked by chrome should be added to leader-boards.

alanhamlett commented 1 year ago

If the browser extension can start detecting language instead of leaving it null then the activity will automatically start showing on leaderboards. The only thing preventing time from the browser from showing on leaderboards is the lack of a language detected.

FlippingBinary commented 1 year ago

The general case would be challenging, but it should be possible to detect the language being edited on specific websites.

For example, Codio sets a data-type attribute that is js, css, or html in my quick test. Unfortunately, they don't seem to use regular text boxes, so some testing and iteration would be necessary to figure out which element is active. The CodeMirror-cursors class object toggles style visibility: hidden off and on in the currently active editor, so that would be one way if nothing better works. Edit: Or someone could just ask the folks over at Codio. They'd probably be really helpful.

For other websites it might be possible to simply extract a filename from some element on the page. It would be trivial to translate a file extension to a language.

There might be some website language detection models that are general enough to be used on multiple coding websites, so those models could be shared to reduce code duplication.