Youtube Logo - Link to subscriptions feed

Change YouTube logo link to user's subscription feed instead of homepage, when logged in, for 2017 and later YouTube layout.

< Отзив за Youtube Logo - Link to subscriptions feed

Отзив: Отлично - скриптът работи

William SavageАвтор
§
Публикуван на: 11.11.2015

Updated 11th November 2015

YouTube updates broke script again. Fixed.

William SavageАвтор
§
Публикуван на: 12.11.2015

Now rewritten to work with AJAX page updates and all top TLDs

§
Публикуван на: 13.11.2015

Greetings friend, I also have a script like this [made it myself, it is not posted on greasyfork though] and I just realized that my script broke because whenever I click a link now the entire page doesn't reload anymore [yeah AJAX page changes] I just wanted to know how you managed to fix that. Your code looks very different from mine, and my code looks very noob-ish compared to yours, but I assume its that addEventListener('DOMNodeInserted') part of your code that listens for page changes.
I hope you reply :D.

William SavageАвтор
§
Публикуван на: 24.11.2015
Greetings friend, I also have a script like this [made it myself, it is not posted on greasyfork though] and I just realized that my script broke because whenever I click a link now the entire page doesn't reload anymore [yeah AJAX page changes] I just wanted to know how you managed to fix that. Your code looks very different from mine, and my code looks very noob-ish compared to yours, but I assume its that addEventListener('DOMNodeInserted') part of your code that listens for page changes.
I hope you reply :D.

Sorry for late reply.

Yes you are correct the addEventListener('DOMNodeInserted') is triggered every time an element changes, this was implemented due to AJAX no longer triggering the original script - just like you said!

I am not a userscript pro, and it is my understanding that using addEventListener('DOMNodeInserted') is not the most efficient method due to being triggered so many times, but I had no better idea! If you find another method please let me know.

The previous version of the script (based off' the original by tolanri @ http://userscripts-mirror.org/users/518143) is here: https://greasyfork.org/en/scripts/13582-youtube-logo-link-to-subscriptions-feed/code?version=86157

William SavageАвтор
§
Публикуван на: 24.11.2015

Hello again Ranie.

After more research I have updated the script to use the following handlers which are only triggered 1-2 times per page load:
document.addEventListener('readystatechange', runScript);
document.addEventListener('spfdone', runScript);

Please see: https://greasyfork.org/en/scripts/13582-youtube-logo-link-to-subscriptions-feed/code?version=89334

Regards :)

Публикувайте отговор

Влезте, за да публикувате отговор.