Advertisement
sentero-esp12

Untitled

Nov 4th, 2021
973
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const targetNode = document.body;
  2.  
  3. const config = {
  4.     childList: true,
  5.     subtree: true
  6. };
  7.  
  8. const callback = function(mutationsList, observer) {
  9.  
  10.     const container = document.querySelector('ytd-page-manager #player-container');
  11.     if (!container) {
  12.         return;
  13.     }
  14.     container.addEventListener('pointerdown', (e) => {
  15.         e.stopImmediatePropagation();
  16.     }, true)
  17.     observer.disconnect();
  18.     console.log('yt done');
  19. };
  20.  
  21. const observer = new MutationObserver(callback);
  22.  
  23. observer.observe(targetNode, config);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement