From 7315cb14e2eed2b09024fa41b24190dcc5ffd32b Mon Sep 17 00:00:00 2001 From: zongor Date: Sun, 28 Apr 2024 00:39:43 -0400 Subject: [PATCH] Update skip-intro.js Add paramount plus and refactor to sub-function --- skip-intro.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/skip-intro.js b/skip-intro.js index ef3cc51..3a86b79 100755 --- a/skip-intro.js +++ b/skip-intro.js @@ -1,7 +1,15 @@ -javascript: (function () { - setInterval(function () { - if (document.getElementsByClassName("skip-credits")[0]) { - document.getElementsByClassName("skip-credits")[0].children[0].click(); +javascript: (() => { + const getClassAndSkip = (name) => { + let skip = document.getElementsByClassName(name).shift(); + if (skip) { + skip.children.shift().click(); } + }; + + setInterval(() => { + // netflix + getClassAndSkip("skip-credits"); + // paramount plus + getClassAndSkip("skip-button"); }, 1e3); })();