browser-wakatime icon indicating copy to clipboard operation
browser-wakatime copied to clipboard

Showing time on leaderboards

Open 3210jr opened this issue 6 years ago • 3 comments

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!

3210jr avatar Apr 26 '18 09:04 3210jr

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

vaibhavhrt avatar May 16 '18 13:05 vaibhavhrt

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.

alanhamlett avatar Mar 16 '23 07:03 alanhamlett

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.

FlippingBinary avatar May 02 '23 13:05 FlippingBinary