I'm trying to build a chrome extension to synchronize Netflix viewing lobbies. The extension injects a script into the Netflix tab when the user navigates to a /watch/
url.
https://github.com/jonnylin13/LongDistance/blob/dev/extension/controller.js
I was able to get the play/pause/seek functions with the following code to work, but for some reason when I ran it today the netflix
object started returning undefined. I assume they must have changed something just today, because it had been working fine in the past.
this.videoPlayer = netflix.appContext.state.playerApp.getAPI().videoPlayer;
this.sessionId = this.videoPlayer.getAllPlayerSessionIds()[0];
this.player = this.videoPlayer.getVideoPlayerBySessionId(this.sessionId);
Is there a certain way that they can hide the netflix
object from the injected script? It still exists when I call it from the debug console.
Any tips would be appreciated, I just want to know if there are known methods to do something like this so I can try and think of a way around it.
I've tried manually setting a timeout and then looking for the netflix
object, but it still returns undefined -- so I'm doubtful it has anything to do with loading.