Files
netflix-speed/netflix-speed.user.js
Alexander Weidinger 267102fa46 Add initial version
2018-10-05 22:35:12 +02:00

35 lines
1.1 KiB
JavaScript

// ==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();