Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
百度网盘播放调速
// ==UserScript==
// @name 百度网盘播放调速
// @namespace http://jaxer.cc/
// @version 1.0
// @description 百度网盘播放调速,1.5倍
// @author jaxer
// @match https://pan.baidu.com/play/video
// @require https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js
// @grant none
// ==/UserScript==
Element.prototype._attachShadow = Element.prototype.attachShadow;
Element.prototype.attachShadow = function (){
return this._attachShadow({mode:"open"});
};
(function() {
'use strict';
$("<select style='position:fixed;left:1rem;top:5rem;width:5rem'><option>1</option><option>1.2</option><option>1.5</option><option>1.8</option></select>")
.appendTo("html")
.on("change",function(){
var rate = $(this).val()
console.log(rate)
var video = $("#video-root")[0].shadowRoot.querySelector("video");
video.playbackRate = rate;
document.title = "播放速度"+ video.playbackRate
})
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.