YouTube Web Tweaks legacy version

This is the legacy version of YouTube Web Tweaks script (if your browser doesn't support JavaScript ES10+ engine)

  1. // ==UserScript==
  2. // @name YouTube Web Tweaks legacy version
  3. // @version 2024.08.12
  4. // @description This is the legacy version of YouTube Web Tweaks script (if your browser doesn't support JavaScript ES10+ engine)
  5. // @author Joey_JTS (original author: Magma_Craft)
  6. // @license MIT
  7. // @match *://www.youtube.com/*
  8. // @namespace https://gf.qytechs.cn/en/users/933798
  9. // @icon https://www.youtube.com/favicon.ico
  10. // @unwrap
  11. // @run-at document-start
  12. // @unwrap
  13. // @grant none
  14. // ==/UserScript==
  15. // Modifiying yt.config flags
  16. (function() {
  17. window['yt'] = window['yt'] || {};
  18. yt['config_'] = yt.config_ || {};
  19. yt.config_['EXPERIMENT_FLAGS'] = yt.config_.EXPERIMENT_FLAGS || {};
  20. var iv = setInterval(function() {
  21. yt.config_.IS_TABLET = true;
  22. yt.config_.DISABLE_YT_IMG_DELAY_LOADING = true;
  23. yt.config_.EXPERIMENT_FLAGS.polymer_verifiy_app_state = false;
  24. yt.config_.EXPERIMENT_FLAGS.desktop_delay_player_resizing = false;
  25. yt.config_.EXPERIMENT_FLAGS.web_animated_actions = false;
  26. yt.config_.EXPERIMENT_FLAGS.web_animated_like = false;
  27. yt.config_.EXPERIMENT_FLAGS.web_animated_like_lazy_load = false;
  28. yt.config_.EXPERIMENT_FLAGS.render_unicode_emojis_as_small_images = true;
  29. yt.config_.EXPERIMENT_FLAGS.smartimation_background = false;
  30. yt.config_.EXPERIMENT_FLAGS.kevlar_refresh_on_theme_change = false;
  31. yt.config_.EXPERIMENT_FLAGS.kevlar_watch_cinematics = false;
  32. }, 1);
  33. var to = setTimeout(function() {
  34. clearInterval(iv);
  35. }, 1000)
  36. })();
  37. // Auto-redirect shorts to watch page
  38. var oldHref = document.location.href;
  39. if (window.location.href.indexOf('youtube.com/shorts') > -1) {
  40. window.location.replace(window.location.toString().replace('/shorts/', '/watch?v='));
  41. }
  42. window.onload = function() {
  43. var bodyList = document.querySelector("body")
  44. var observer = new MutationObserver(function(mutations) {
  45. mutations.forEach(function(mutation) {
  46. if (oldHref != document.location.href) {
  47. oldHref = document.location.href;
  48. console.log('location changed!');
  49. if (window.location.href.indexOf('youtube.com/shorts') > -1) {
  50. window.location.replace(window.location.toString().replace('/shorts/', '/watch?v='));
  51. }
  52. }
  53. });
  54. });
  55. var config = {
  56. childList: true,
  57. subtree: true
  58. };
  59. observer.observe(bodyList, config);
  60. };

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址