Greasy Fork is available in English.

Mute Peacock Ads

Mutes ads on Peacock

  1. // ==UserScript==
  2. // @name Mute Peacock Ads
  3. // @namespace mute-peacock-ads
  4. // @description Mutes ads on Peacock
  5. // @version 0.2
  6. // @match https://www.peacocktv.com/*
  7. // @icon https://www.google.com/s2/favicons?domain=peacocktv.com
  8. // ==/UserScript==
  9.  
  10. setInterval(function(){
  11. var adCountdown = document.querySelector('.ad-countdown__remaining-time')
  12. var muteButton = document.querySelector('button.playback-button[aria-label="Mute Sound"]')
  13. var unmuteButton = document.querySelector('button.playback-button[aria-label="Unmute Sound"]')
  14.  
  15. if(adCountdown === null & unmuteButton != null){
  16. unmuteButton.click()
  17. }
  18. if(adCountdown != null & muteButton != null){
  19. muteButton.click()
  20. }
  21. }, 1000)