您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Makes example sentence translations visible on mouseover
当前为
// ==UserScript== // @name WK Lesson Spoiler Tags // @namespace ktx_wk_lesson // @version 0.1 // @description Makes example sentence translations visible on mouseover // @author Karsten Rohweder // @match https://www.wanikani.com/lesson/session // @grant GM_addStyle // ==/UserScript== var $ = unsafeWindow.jQuery; function addSpoilerEffect() { var elms = $('.context-sentence-group > p:nth-child(2)'); if (elms.length > 0) { elms.addClass('ktx_spoiler'); return true; } return false; } (function() { 'use strict'; GM_addStyle('.ktx_spoiler { color: transparent; text-shadow: 0 0 15px #aaa; } .ktx_spoiler:hover { color: black; text-shadow: none }'); var observer = new MutationObserver(function(mutations){ mutations.forEach(function(mutation){ if (mutation.type == 'childList') { addSpoilerEffect(); } }); }); var observerConfig = { attributes: true, childList: true, subtree: true }; observer.observe(document.body, observerConfig); })();