Advertisement
Guest User

Untitled

a guest
Apr 9th, 2022
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function() {
  2.     'use strict';
  3.  
  4.     window.addEventListener("load", function(event) {
  5.         if (window.location.pathname == '/') return;
  6.  
  7.         const node = document.querySelector('.video-player__overlay');
  8.  
  9.         if (!node) {
  10.             return
  11.         }
  12.  
  13.         new MutationObserver((mutations) => {
  14.             mutations.forEach(mutation => {
  15.                 if (!mutation.addedNodes.length) {
  16.                     return
  17.                 }
  18.  
  19.                 const div = mutation.addedNodes[0]
  20.  
  21.                 if (!div.classList.contains('content-overlay-gate')) {
  22.                     return
  23.                 }
  24.  
  25.                 setTimeout(() => {
  26.                     div.children[0].children[2].children[0].click()
  27.                 })
  28.  
  29.             })
  30.         }).observe(node, { childList: true, subtree: true })
  31.     });
  32. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement