-
Notifications
You must be signed in to change notification settings - Fork 1
/
TampermonkeyCode
55 lines (50 loc) · 1.79 KB
/
TampermonkeyCode
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match *://*.zhihuishu.com/learning/videoStudy*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var fa=$("body");
var btn=$("<li></li>");
var json={
"background":"#31e16d",
"height":"16px",
"padding":"5px",
"cursor": "pointer",
"top":"300px",
"right":"80px",
"position": "fixed"
};
btn.css(json);
btn.html("<span id='lfsenior'>开启自动播放模式</span>");
fa.append(btn);
var bodywidth=$("#body").css("width");
var mainwidth=$("#main").css("width");
btn.click(function () {
$("#lfsenior").html("自动模式已开启");
//关闭弹题
setInterval(function(){
//开启倍速播放
document.getElementsByClassName("speedTab15")[0].click();
$(".popboxes_close").click();
//获取当前进度
//var spans=$(".current_play span");
var progress=$(".progress-num").width();
if("100"==progress){
//播放完毕
$(".nextButton").click()
}else{
$("#vjs_container_html5_api")[0].play();
$("#vjs_container_html5_api")[0].muted=true;
}
$("#lfsenior").html("自动模式已开启,本章进度:"+progress+"%");
},100);
});
//开启自动模式
document.getElementById("lfsenior").click();
})();