Created
November 28, 2024 22:44
-
-
Save hushin/70cced91f23c4530ae18cb1ee2aab0a3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name netflix rewind advance | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-11-28 | |
// @description netflix で z,x キーで巻き戻し、早送りする | |
// @author hush_in | |
// @match https://www.netflix.com/watch/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=netflix.com | |
// @grant none | |
// ==/UserScript== | |
;(function () { | |
'use strict' | |
window.addEventListener( | |
'keydown', | |
function (event) { | |
const seek = (diff) => { | |
const videoPlayer = | |
window.netflix.appContext.state.playerApp.getAPI().videoPlayer | |
const player = videoPlayer.getVideoPlayerBySessionId( | |
videoPlayer.getAllPlayerSessionIds()[0], | |
) | |
player.seek(player.getCurrentTime() + diff) | |
event.stopImmediatePropagation() | |
event.preventDefault() | |
} | |
if (event.key === 'z') { | |
seek(-10000) | |
} | |
if (event.key === 'x') { | |
seek(10000) | |
} | |
}, | |
true, | |
) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment