Add initial version
This commit is contained in:
34
netflix-speed.user.js
Normal file
34
netflix-speed.user.js
Normal file
@@ -0,0 +1,34 @@
|
||||
// ==UserScript==
|
||||
// @name netflix-speed
|
||||
// @version 0.1
|
||||
// @include https://www.netflix.com/watch/*
|
||||
// ==/UserScript==
|
||||
|
||||
var speed_control = document.createElement('select');
|
||||
speed_control.style.cssText = `
|
||||
border:none;
|
||||
-moz-appearance: none;
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
cursor: pointer;
|
||||
background: none;
|
||||
`;
|
||||
speed_control.onchange = function() {
|
||||
document.getElementsByClassName('VideoContainer')[0].getElementsByTagName('video')[0].playbackRate = this.value;
|
||||
};
|
||||
speed_control.innerHTML = `<option value=0.5>0.5</option>
|
||||
<option value=0.75>0.75</option>
|
||||
<option value=1.0 selected="selected">Normal</option>
|
||||
<option value=1.25>1.25</option>
|
||||
<option value=1.5>1.5</option>
|
||||
<option value=1.75>1.75</option>
|
||||
<option value=2.0>2.0</option>`;
|
||||
function append(){
|
||||
if(!document.getElementsByClassName('PlayerControlsNeo__controls-group').length) {
|
||||
setTimeout(append, 200);
|
||||
} else {
|
||||
console.log(document.getElementsByClassName('PlayerControlsNeo__controls-group')[0]);
|
||||
document.getElementsByClassName('PlayerControlsNeo__controls-group')[0].appendChild(speed_control);
|
||||
}
|
||||
}
|
||||
append();
|
||||
Reference in New Issue
Block a user