Userscripts broken again?

Just me or are they all broken again? I can’t seem to get them up and running at the moment.

Same for me, none work right now.

All of my scripts seem to be borked as well.

The console has a lot off errors that I frankly don’t understand. Here is the beginning of something that I think might matter:

“The page’s settings blocked an inline script (script-src-elem) from being executed because it violates the following directive…”

Running firefox.

I’m tired, boss…

I just updated Chrome and now double-check stopped working. My other scripts are still working as expected. I also use progress percentages and level duration. I’ve tried disabling, reordering and reinstalling everything. Even reinstalled tampermonkey and restarting browser after each step. They should just build some of these scripts natively to WK.

Same here, I use 3 scripts and they’re all broken. One interesting finding I have is that the Open Framework tries to find a symbol with a `wk-icon` ID, which doesn’t seem to exist on the page anymore (instead, there’s a HTML tag called `<wk-icon…>` which seems a bit curious. This is the line that breaks in the Open Framework Menu module:

let svg = document.querySelector('svg symbol[id^="wk-icon"]').closest('svg');

(And you might see the same error in the console, .closest() fails because the querySelector() returns null

There r more details here, the latest update messed up open framework bc of what @Nate30 says above

I’m disappointed that when I saw the title my first thought “Is it that time of the week already?”

This is really annoying :confused: I dont want to make bunch of small mistakes and send some easy kanjis back to stone age :confused:

Found the cause for me, and got Claude to diagnose and fix it. Here’s the diagnosis:

Symptoms: on review pages the script gear/menu is missing, Double-Check dies, and Keisei, Pitch Info, Rendaku Information etc. fail to install their menu entries. The console shows this repeatedly:

TypeError: Cannot read properties of null (reading ‘closest’)
at insert_gear_icon
at install_scripts_header
at Object.insert_script_link

Cause: the wkof Menu module (v1.0.25), in insert_gear_icon, does:

document.querySelector(‘svg symbol[id^=“wk-icon”]’).closest(‘svg’)

On the review page there is no inline containing a whose id starts with “wk-icon” any more (the Keisei warning “Icons.VERSION_NUM is deprecated. Use Icons.iconsVersion instead” suggests the icon setup changed), so querySelector returns null and the call throws. Every script that goes through wkof.Menu.insert_script_link fails the same way, and Double-Check’s setup stops at that call, so it never finishes starting.

Workaround: a tiny userscript that adds a hidden empty symbol at document-start, so the lookup succeeds:

// ==UserScript==
// @name WaniKani wkof Menu Shim
// @match https://www.wanikani.com/*
// @match https://preview.wanikani.com/*
// @run-at document-start
// @grant none
// ==/UserScript==
(function () {
‘use strict’;
const ID = ‘wkof-menu-shim’;
function ensure() {
try {
if (document.getElementById(ID)) return;
if (document.querySelector(‘svg symbol[id^=“wk-icon”]’)) return;
const root = document.documentElement;
if (!root) return;
root.insertAdjacentHTML(‘beforeend’,
‘’ +
‘’);
} catch (e) {}
}
ensure();
document.addEventListener(‘DOMContentLoaded’, ensure);
document.addEventListener(‘turbo:load’, ensure);
})();

With this installed, the gear icon came back on review pages and Double-Check works again for me (Safari + Tampermonkey, wkof 1.2.10). It only adds the element when the page has none, so it should be harmless once the Menu module is fixed properly.

YMMV: I can’t see what other browsers or setups do, so reports welcome.

// ==UserScript==
// @name WaniKani wkof Menu Shim
// @namespace varun.wanikani.shim
// @version 0.1.0
// @description Stopgap: wkof’s Menu module crashes on the review page when no exists. This adds a hidden one so the gear/script menu can install. Delete once wkof is fixed.
// @match https://www.wanikani.com/*
// @match https://preview.wanikani.com/*
// @run-at document-start
// @grant none
// ==/UserScript==

(function () {
‘use strict’;
const ID = ‘wkof-menu-shim’;

function ensure() {
try {
if (document.getElementById(ID)) return;
// Only add it if the page has no suitable symbol of its own.
if (document.querySelector(‘svg symbol[id^=“wk-icon”]’)) return;
const root = document.documentElement;
if (!root) return;
root.insertAdjacentHTML(‘beforeend’,
‘’ +
‘’);
} catch (e) { /* never break the page */ }
}

ensure(); // as early as possible
document.addEventListener(‘DOMContentLoaded’, ensure);
document.addEventListener(‘turbo:load’, ensure); // after Turbo navigations
})();