aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content.js51
1 files changed, 45 insertions, 6 deletions
diff --git a/content.js b/content.js
index b6a0cdc..977f170 100644
--- a/content.js
+++ b/content.js
@@ -1,8 +1,47 @@
-// Didn't work
-netflix.reactContext.models.truths.data.skipCreditsEnabled = false;
+function with_player (callback) {
+ var interval = setInterval(
+ function() {
+ var player = document.querySelector('.NFPlayer.nf-player-container');
-// Didn't work
-netflix.reactContext.models.truths.data['wwwplayer.config.skip.credits.enabled'] = false
+ if (player) {
+ clearInterval(interval);
-// Didn't work
-netflix.reactContext.models.fastProps.data['wwwplayer.config.skip.credits.enabled'] = false
+ callback(player);
+ }
+ },
+ 1000
+ );
+}
+
+function init_mutation_observer (player) {
+ var observer = new MutationObserver(function(mutation_list) {
+ for (var i = 0; i < mutation_list.length; i++) {
+ var mutation = mutation_list[i];
+
+ console.log(
+ mutation.target.className +
+ '\n' +
+ mutation.oldValue
+ );
+
+ if (mutation.target.classList.includes('postplay')) {
+ mutation.target.classList = mutation.target.classList.filter(function(c) {
+ return c !== 'postplay';
+ });
+ }
+ }
+ });
+
+ observer.observe(
+ player,
+ {
+ attributeFilter: ['class'],
+ attributeOldValue: true
+ }
+ );
+}
+
+
+with_player(function(player) {
+ init_mutation_observer(player);
+});