您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
自动展开极客时间本地网页的评论,并嵌入音频(需要开启允许访问文件网址)
// ==UserScript== // @name 极客时间本地网页优化 // @license MIT // @namespace http://tampermonkey.net/ // @version 0.3 // @description 自动展开极客时间本地网页的评论,并嵌入音频(需要开启允许访问文件网址) // @author You // @match file:///*/* // @include file:///*/* // @icon https://www.google.com/s2/favicons?domain=undefined. // @grant none // ==/UserScript== (function() { 'use strict'; document.querySelectorAll("ul>li>div").forEach(e=>{ var comment = e.children[1]; if (comment.children[0] != undefined) { comment.style.display = "block"; } }); document.getElementsByTagName("base")[0].remove(); var str = location.href; var arr = str.split("/"); var file_path = arr[arr.length - 1]; var mp3 = file_path.replace(".html", ".mp3"); // 将audio添加到首部 var audio = document.createElement("audio"); audio.setAttribute("controls", ""); audio.style.position = "relative"; audio.style.top = "80px"; audio.style.margin = "0 auto"; audio.style.display = "block"; audio.setAttribute("id", "mp3-player"); var app = document.getElementById("app"); app.insertBefore(audio, app.firstElementChild); // 添加MP3 var sourceMp3 = document.createElement("source"); sourceMp3.setAttribute("src", mp3); sourceMp3.setAttribute("type", "audio/mpeg"); sourceMp3.autoplay=false; audio.appendChild(sourceMp3); audio.autoplay=false; document.title=document.querySelector("h1").innerText; // Your code here... })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址