YouTube scroll to top on home button

Scroll page to top when press on YouTube logo!

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         YouTube scroll to top on home button
// @namespace    http://tampermonkey.net/
// @version      1.0.0
// @license      MIT
// @description  Scroll page to top when press on YouTube logo!
// @author       alezhu
// @match        https://www.youtube.com/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant        none
// @homepageURL    https://github.com/alezhu/youtube-scroll-to-top-on-press-logo
// @supportURL     https://github.com/alezhu/youtube-scroll-to-top-on-press-logo/issues
// ==/UserScript==

(function () {
  "use strict";

  let elLogo = document.getElementById("logo");
  elLogo &&
    elLogo.addEventListener &&
    elLogo.addEventListener("click", function () {
      console.log("Go to TOP!!!");
      window.scrollTo(0, 0);
    });
})();