Greasy Fork is available in English.

Discussões » Criação de Solicitações

fixing a notable script Youtube page load performance

§
Publicado: 10/11/2022
Editado: 10/11/2022

i hound a script on stackoverflow that could be extemely useful for youtube load page speed however there is an issue, the code that's involved is extremely old and it uses jquery and i am trying to solve errors within the code and or use something other than jquery. need assistance
***note*** there's also externals for this userscript that needs to be fixed as well

Website:https://stackoverflow.com/questions/30206116/youtube-increase-page-load-speed-greasemonkey-jquery/30206117#30206117
___ORIGINAL_____
// ==UserScript==
// @name Youtube: Page load performace
// @namespace computerarea / twitter
// @description hide / shows elements to increase page load time
// @include https://www.youtube.com/watch?*
// @version 1
// @grant GM_addStyle
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js
// ==/UserScript==

///*Hides by defualt*///
$('#watch-discussion').hide(0);
$('#yt-masthead').hide(0);
$('.yt-user-photo.g-hovercard').hide(0);
$('#watch7-sidebar-contents').hide(0);
$('#footer-container').hide(0);
$('#player-api').hide(0);

///*Actions that change defualts*///
$("#masthead-positioner").click(function(){
$('#yt-masthead').delay(500).show(0);
$('.yt-user-photo.g-hovercard').delay(500).show(0);
$('#watch7-sidebar-contents').delay(500).show(0);
$('#footer-container').delay(500).show(0);
$('#watch-discussion').delay(500).show(0);
});
$("#eow-title").click(function(){
$('#player-api').delay(500).show(0);
});

///*DO NOT TOUCH*///
var script = unsafeWindow.document.createElement("SCRIPT");
script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js';
script.type = 'text/javascript';
unsafeWindow.document.getElementsByTagName("head")[0].appendChild(script);
script.addEventListener('load', function(){
jQuery = unsafeWindow['jQuery'];
unsafeWindow['$_'] = jQuery.noConflict(true);
}, false);

NotYouMod
§
Publicado: 11/11/2022

This question is 7 years old. (question on SO)

§
Publicado: 12/11/2022

As far as I know, the only effective way to youtube speedup is

  1. Mobile version m.youtube.com
  2. Alternative mirrors like Invidious
  3. Applying some experimental flags

3.1 https://greasyfork.org/en/scripts/447802-youtube-web-tweaks

3.2 https://greasyfork.org/en/scripts/431573-youtube-cpu-tamer-by-animationframe

4 Redirecting video to local players using like youtube-dl libraries

4.1 #1

4.2 #2

You can look for magic scripts if you believe in magic - https://greasyfork.org/en/scripts?q=cpu+youtube

§
Publicado: 12/11/2022

The script you provided is lazy loading of some elements. In principle, YouTube is now taking a similar approach.

It is possible to revive this script, the problem is that it is useless

Publicar resposta

Faça o login para publicar uma resposta.