🏠 Home 

Refresh youtube videos (uBlock Origin Lite ad workaround)

When a video starts, this refreshes the new video immediately as workaround to issue of uBlock Origin Lite not blocking the unwanted content and requiring manual refresh.


安装此脚本?
  1. // ==UserScript==
  2. // @name Refresh youtube videos (uBlock Origin Lite ad workaround)
  3. // @namespace http://tampermonkey.net/
  4. // @description When a video starts, this refreshes the new video immediately as workaround to issue of uBlock Origin Lite not blocking the unwanted content and requiring manual refresh.
  5. // @version 2024-12-29_3
  6. // @author Xcape
  7. // @match https://www.youtube.com/*
  8. // @icon https://lh3.googleusercontent.com/lsanoOfx5N_t-7gh5Qg9FGIirVEjdCqalZXyLZYRd5d7Fydm83FQhu4Oq0JmlRyMtyF_LfwuQQZyKRTHs6emnFirsA=s60
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12. (function() {
  13. 'use strict';
  14. let checkID = localStorage.getItem('checkID');
  15. setInterval(() => {
  16. const videoID = new URLSearchParams(window.location.search).get('v');
  17. if (videoID !== null) {
  18. if (videoID !== checkID) {
  19. checkID = videoID;
  20. localStorage.setItem('checkID', checkID);
  21. setTimeout(() => {
  22. location.reload();
  23. }, 500);
  24. }
  25. } else {
  26. localStorage.setItem('checkID', 'blahblah');
  27. }
  28. }, 100);
  29. })();