Greasy Fork is available in English.

Mute Freevee Ads

Mutes ads on Freevee

  1. // ==UserScript==
  2. // @name Mute Freevee Ads
  3. // @namespace mute-freevee-ads
  4. // @version 0.3
  5. // @license Doesn't matter
  6. // @description Mutes ads on Freevee
  7. // @match https://www.amazon.com/*
  8. // ==/UserScript==
  9.  
  10. (() => {
  11. const observer = new MutationObserver(function(mutations_list) {
  12. const checkNodes = (nodes, value) => {
  13. nodes.forEach((node) => {
  14. console.log('checking node', value, node)
  15. if(node.classList.contains('atvwebplayersdk-ad-timer')){
  16. document.querySelectorAll('video').forEach((video) => {
  17. video.muted = value
  18. })
  19. }
  20. })
  21. }
  22.  
  23. mutations_list.forEach((mutation) => {
  24. checkNodes(mutation.addedNodes, true)
  25. checkNodes(mutation.removedNodes, false)
  26. })
  27. })
  28.  
  29. observer.observe(document, { subtree: true, childList: true });
  30. })()