您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a quiz button to the sitemap menu (one click access)
// ==UserScript== // @name Self-study quiz button // @namespace http://tampermonkey.net/ // @version 0.1 // @description Adds a quiz button to the sitemap menu (one click access) // @author Skymaiden // @include /^https://(www|preview).wanikani.com// // @exclude /^https://(www|preview).wanikani.com/(review|lesson)/ // @grant none // ==/UserScript== /* jshint esversion: 6 */ (function() { 'use strict'; const sitemapMenu = document.querySelector('.sitemap'); const buttonContent = document.createElement('a'); buttonContent.href = '#'; buttonContent.innerText = 'Quiz'; buttonContent.style.paddingLeft = '14px'; buttonContent.style.marginLeft = '8px'; buttonContent.addEventListener('click', function() { if (window.ss_quiz && window.ss_quiz.open) { window.ss_quiz.open(); } else { console.warn('Please install the Self-Study Quiz script'); } }); const button = document.createElement('li'); button.classList.add('sitemap__section', 'navigation-shortcut'); button.append(buttonContent); sitemapMenu.prepend(button); })();