您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Randomizes the preferred voice actor
// ==UserScript== // @name Wanikani: Random voice actor // @description Randomizes the preferred voice actor // @match https://www.wanikani.com/* // @match https://preview.wanikani.com/* // @require https://greasyfork.runtimutd.eu.org/scripts/462049-wanikani-queue-manipulator/code/WaniKani%20Queue%20Manipulator.user.js?version=1340063 // @version 1.2.4 // @author Kumirei // @license MIT; http://opensource.org/licenses/MIT // @grant none // @namespace https://greasyfork.runtimutd.eu.org/users/105717 // ==/UserScript== ;(function () { // Set up randomized voice actor window.wkQueue.addPostprocessing((queue) => { for (let item of queue) { if (!('readings' in item.subject)) continue // Only vocab items for (let reading of item.subject.readings || []) { if (!reading.pronunciations.length) continue // Only items with audio // Pick random pronunciation and then set all actors' audio to be that pronunciation const random_index = Math.floor(Math.random() * reading.pronunciations.length) const sources = reading.pronunciations[random_index]?.sources if (!sources.length) continue for (let pronunciation of reading.pronunciations) pronunciation.sources = sources } } }) })()