您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
ニコニコ大百科のピコカキコプレーヤーをFlMMLonHTML5に置き換える (デバッグ用)
当前为
// ==UserScript== // @name Nicopedia-FlMMLonHTML5 // @namespace https://github.com/kosh04/FlMMLonHTML5 // @version 0.20181016 // @description ニコニコ大百科のピコカキコプレーヤーをFlMMLonHTML5に置き換える (デバッグ用) // @grant GM_getResourceText // @match http://dic.nicovideo.jp/* // @match https://dic.nicovideo.jp/* // @resource flmmlworker.js https://carborane3.github.io/FlMMLonHTML5/flmmlworker.js // @noframes // @author kosh (mono) // ==/UserScript== function loadScript(src) { var s = document.createElement("script"); s.type = "text/javascript"; s.src = src; document.head.appendChild(s); } // NOTE: バージョンは flmmlonthml5.js のヘッダーコメント参照 loadScript("https://carborane3.github.io/FlMMLonHTML5/flmmlonhtml5.js"); loadScript("https://carborane3.github.io/FlMMLonHTML5/flmmlplayer.js"); const code = GM_getResourceText("flmmlworker.js"); const blob = new Blob([code], { type: "text/javascript" }); const workerURL = URL.createObjectURL(blob); document.querySelectorAll("[id^=piko]").forEach(piko => { const m = piko.id.match(/^piko(?:bbs|list)?(\d+)/); if (!m) return; const mml_id = m[1]; // "piko777" -> "777" const option = JSON.stringify({ mmlURL: `/mml/${mml_id}`, height: "1.65em", underground: true, workerURL: workerURL }); const code = `(function(elem) { var player = new FlMMLPlayer(${option}); elem.parentNode.replaceChild(player.svg, elem); })(this)`; const imgPikoplayer = piko.children.item(0); imgPikoplayer.setAttribute("onclick", code); });