您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
For every vocabulary item, it lists all other vocabulary items with the same reading.
// ==UserScript== // @name WaniKani Homophone Explorer // @namespace waniKaniHomophoneExplorer // @version 0.18 // @description For every vocabulary item, it lists all other vocabulary items with the same reading. // @author Sinyaven // @license MIT-0 // @match https://www.wanikani.com/* // @match https://preview.wanikani.com/* // @require https://greasyfork.org/scripts/430565-wanikani-item-info-injector/code/WaniKani%20Item%20Info%20Injector.user.js?version=1492607 // @grant none // ==/UserScript== (async function() { 'use strict'; /* global wkof, wkItemInfo */ wkof.include(`ItemData`); await wkof.ready(`ItemData`); let items = await wkof.ItemData.get_items({wk_items: {filters: {item_type: `voc`}}}); let byReading = wkof.ItemData.get_index(items, `reading`); wkItemInfo.forType(`vocabulary`).under(`reading`).appendSideInfo(`Homophones`, o => { return o.reading.flatMap(r => byReading[r] ?? []).filter(i => i.id !== o.id).flatMap((i, idx) => { let result = []; if (idx !== 0) result.push(`, `); let link = document.createElement(`a`); link.href = i.data.document_url; link.target = `_blank`; link.textContent = i.data.characters; result.push(link); return result; }); }); })();