[Userscript] Tofugu Latest

:warning: This is a third-party script/app and is not created by the WaniKani team. By using this, you understand that it can stop working at any time or be discontinued indefinitely.

This is the initial release of the Tofugu Latest user script.

This script simply adds a section to your dashboard with links to the most recent articles on Tofugu.com:

The section is added before Recent Community Topics.

Articles that you’ve already visited in your current browser will be shown in a lighter font. The rightmost column shows how old the article is in days.

HUGE thanks to Viet and the Tofugu crew for helping me to resolve a cross-origin permissions issue.

I’ve only done modest testing with this script. Please let me know in this thread if you run into any issues or have any suggestions or concerns.

Installation Instructions

  1. Install tampermonkey.
  2. Install Tofugu Latest.
  3. Live, love, read, and do your reviews!

The Wanikani Open Framework is not required for this script.

39 Likes

I dig it! Thank you for making this!

1 Like

You’re welcome! It makes me happy, too. I’ve got a rather ridiculous backlog of stuff on Tofugu that I want to read, but at least I won’t miss new stuff now!

2 Likes

Installed! Thank you! :blush:

1 Like

This is really cool! Gonna install once I get home! ^^

2 Likes

Ooh great stuff! I love tofugu’s articles but sometimes forget to check the site so this is really useful. Thank you! :grinning_face_with_smiling_eyes:

1 Like

I installed the script, but interestingly see the section twice.


I’m using Firefox on a Windows 10 PC. The other Tampermonkey scripts I’m using are the Wanikani Open Framework, Double-Check, and Stroke Order.

2 Likes

That’s pretty weird. I can’t think of any obvious way that could happen unless the script is run twice somehow.

I’ll try on Firefox, but could you try temporarily disabling all other scripts except this one? I’m wondering if there is some strange interaction with another script.

Did so, and it still appears twice. Strange.

Cool! thank you :hugs:

1 Like

Hmmm…

This is really strange. It’s the very final line in the script that is somehow being run twice:

// Now add our new div at the just before the forum list
      document.querySelector(".forum-topics-list").before(tlSection);

If the entire script or even just that line were run twice the result would be exactly what you’re seeing.

The only other thing I can think of to try at the moment, is to remove the script entirely, restart your browser, then reinstall the script.

If the problem persists I’ll try to add some console logging to figure out what’s happening.

Whoa! This is fantastic. Thank you @Rrwrex.

1 Like

Now I can get all updates about Etoeto directly on my dashboard! Thanks!

4 Likes

Eto … eto … for a minute there I wondered: what’s “etocto”? :wink:

I’ve had no luck wishing harder, either. <laugh>

Did as you suggested, and it’s still appearing twice. :thinking:

Darn. I cannot replicate this problem with firefox on my mac. I’ve loaded the Double Check script, but the bug still doesn’t manifest itself. Double Check only affects review pages, not the dashboard, so it’s unlikely to be the problem anyway.

Can you point me to the actual Stroke Order script you’re using? There are multiple different stroke order scripts and I want to ensure I’m replicating your environment as closely as I can (albeit macOS rather than Windows).

All I can imagine is that the Tofugu Latest script is being executed twice on your system for some reason.

Let’s at least verify that by logging a debug message:

  1. Open the Tampermonkey dashboard by clicking on the icon in the upper right of your browser window.

  2. Click the “enabled” button next to every script except Tofugu Latest to turn them off.

  3. Click on the text “Tofugu Latest” which will open the script in an editor window.

  4. Scroll down to the very bottom and find the line containing document.querySelector(".forum-topics-list").before(tlSection);

  5. Add a line immediately after the querySelector() call but before the closing braces that reads console.log("Exiting Tofugu Latest");

  6. Click File then Save in the editor window.

  7. Now either open a new tab or refresh the tab in your browser for https://www.wanikani.com (ctrl-R or click the little reload icon

  8. Right click anywhere on the screen and select inspect. This will open the developer tools at the bottom of your screen.

  9. Click on the “Console” button in the developer tools.

  10. You’ll likely see several warnings and errors for various things that Firefox doesn’t like that are unrelated to this issue (pure tampermonkey and Wanikani dashboard complaints). Turn those off for now by clicking on “Errors” and “Warn” on the second row of the developer tools.

  11. You should be left with just one white line reading “Exiting Tofugu Latest”, but I’m pretty certain you’ll see two such lines.

Here’s what I get in firefox:

If your setup is indeed running the script twice for some reason as I suspect, I’m unsure what might be causing it.

Let’s verify first by following the steps above, but if the script is getting executed twice, it may be necessary to disable any other firefox extensions and reinstall tampermonkey in its entirety.

Since this script is the only thing new in your environment, it’s seems the Tofugu Latest script itself is the most likely culprit, but I can’t think of anything in such a simple script that might cause this to occur.

If anyone else has any ideas, I’m all ears.

Apologies for taking some time to come back to you. This is the Stroke Order script I’m using.

I followed the steps you listed, and am seeing this:

No worries about the delay, but now I’m really mystified.

It appears the script is only being executed one time, but the Tofugu Latest section is being added to the DOM twice.

I added the same Stroke Order script, but when I try it in a fresh install of Firefox with just tampermonkey and those three scripts installed, I only see the section inserted once.

Ordinarily, I’d assume my script is at fault (both on general principles and because it was the last that changed in your environment :slight_smile: ). Because I’m unable to reproduce it, though, and because nobody else has reported this problem, I think it must be something in your environment that is causing this.

I can’t even hazard a guess as to what it might be, though. Let me think for a bit.

@Kumirei @BIsTheAnswer – sorry for the ping, but any ideas? I’m totally mystified.

1 Like

Actually: could you click on Errors and Warnings in the inspector to display them again and send me the entire output? You’re getting many more errors and warnings than I am in a fresh Firefox install. I’m hoping there’s a hint in there.

You can drag the inspector window up to take up more real-estate.

Things that I would check for

  1. You don’t have two installations in your script handler?
  2. You don’t have two installations in two different script handlers?
  3. You don’t accidentally have it installed directly in the browser (check extensions)
  4. Try turning off any ad-blockers or other privacy-oriented extensions
  5. Insert some console logging to figure out if some code is actually being run twice (presumably Rrwrex could provide this for you so you could just copy/paste the whole script)
3 Likes