mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-08-29 12:07:09 +00:00
Safeguard Netflix player session ID lookup in background.js
This commit is contained in:
@@ -1672,7 +1672,8 @@ function installPageApiSeekBridge() {
|
|||||||
try {
|
try {
|
||||||
if (match.provider === 'netflix') {
|
if (match.provider === 'netflix') {
|
||||||
const videoPlayer = window.netflix?.appContext?.state?.playerApp?.getAPI?.().videoPlayer;
|
const videoPlayer = window.netflix?.appContext?.state?.playerApp?.getAPI?.().videoPlayer;
|
||||||
const sessionId = videoPlayer?.getAllPlayerSessionIds?.()[0];
|
const ids = videoPlayer?.getAllPlayerSessionIds?.();
|
||||||
|
const sessionId = ids ? ids[0] : null;
|
||||||
const player = sessionId ? videoPlayer.getVideoPlayerBySessionId(sessionId) : null;
|
const player = sessionId ? videoPlayer.getVideoPlayerBySessionId(sessionId) : null;
|
||||||
player?.seek(Math.round(time * 1000));
|
player?.seek(Math.round(time * 1000));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user