[Userscript] Lesson/Review Count in Forums

Ah, that makes a lot of sense. Thank you!

Hey, has anybody made something like this for the Dashboard/ wanikani.com? I miss having it up in the top bar with numbers…

1 Like

I think what you want is @Kumirei’s script [Lessons & Reviews In Header].
It’s listed in [Kumirei’s Userscripts] thread.

3 Likes

Thank you! : D

1 Like

I have this script and @Kumirei’s Like Counter script installed on my forum page. Every time I refresh the page (with Chrome’s refresh button) the active script counter on Tampermonkey icon increase by two. This is no big deal but I thought you would want to know.

I use up-to-date Chrome on Windows 10.

Based on a little bit of experimentation, it seems to do this with only Kumi’s script installed. No idea what could be causing it. Seems like that should be a Tampermonkey bug since there shouldn’t be a way (from within Javascript) to directly affect the script count.

Interesting. I’ve been experiencing the bug as well, but I didn’t know it was due to the like counter. I have no idea what might be the cause

An interesting mystery. Let me know if you figure it out. I would attempt it myself if I didn’t have a product demo next week.

1 Like

Actually, I am still experiencing the bug with the Like Counter turned off, so I don’t think it’s specifically that one script. A hard refresh seems to reset the count, while a regular refresh increments it.

I don’t have this bug with the Wanikani dashboard scripts. If it is Tapermonkey acting out it does so only in the forums.

@Kumirei
I wonder if Discourse is loading multiple iframes for some reason, and scripts are being loaded per-iframe. It could be a Discourse bug!

Edit: Well, if that’s the case, doing a console.log() inside the script isn’t showing more than one message in the console. I wonder if iframes log to the same instance of the console. I’ve noticed before certain devtool behavior is different for iframes.

1 Like

Would that cause the number to increase at every refresh? I would think it would only cause a static multiplication of the number, not an increment at every refresh

Unless discourse had some sort of state bug, which I’ve seen before with a stuck-open post editor.
But I’m not sure if that’s the case here.

1 Like

Also, wondering if it can be reproduced on meta.discourse.com.

Yep. Happening there for me with only Spongebob Timecards and a Youtube link highlighter script active

1 Like

Whenever I’m on any page on the forum (and scroll down from the top of the page, even just a bit), and then click the button with my profile pic to check notifications, the page scrolls down a whole page. Doesn’t happen when scripts are disabled, and it seems like it is related to any scripts that uses the header like this script, or @Kumirei’s Like Counter or Regular Status scripts.

This header
image

Haven’t seen anyone mention it, so hope it’s not just me. Has been like this for a few days.

Edit: Huh… happens when I click the search button :mag: and hamburger menu too.

image

2 Likes

Interesting. I hadn’t noticed it but it’s happening to me too. All three scripts seem to cause this separately. Unless rfindley beats me to it I will look into it when I get the time. I have plenty of other scripts to have a look at as well, though

2 Likes

I’m definitely not going to beat you to it :slight_smile:
November is going to be a crazy work schedule for me.

But yes… I see it, too. I never noticed it before now.

3 Likes

I just took a look at it. It’s caused by the change of the header’s height to inherit rather than 4em. I didn’t figure out why that would cause it to jump when you do other things, but to fix it you can just change .float_wkappnav .d-header {height: inherit;} to padding-bottom: 2em and it will look just the same

3 Likes

Fixed, thanks!

:point_right: [v1.0.18] - Fixed scroll-down when opening menu.

4 Likes