developer.chrome.com fast back/forward

Makes back/forward navigation fast as they should be instead of half a second

06.12.2023 itibariyledir. En son verisyonu görün.

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        developer.chrome.com fast back/forward
// @namespace   https://greatest.deepsurf.us/en/users/2159-woxxom
// @description Makes back/forward navigation fast as they should be instead of half a second
// @version     1.0.1
// @license     MIT
// @match       https://developer.chrome.com/*
// @run-at      document-start
// @grant       none
// ==/UserScript==

const {addEventListener} = window;
window.addEventListener = function (type) {
  if (type !== 'popstate') addEventListener.apply(this, arguments);
};
Object.defineProperty(history, 'scrollRestoration', {
  value: history.scrollRestoration = 'auto',
  writable: false,
});
addEventListener('click', e => {
  const a = e.target.closest('a');
  if (a && a.href && a.getAttribute('href') !== '#') {
    e.stopPropagation();
    a.click();
    if (!document.getElementById(a.hash.slice(1)))
      (document.querySelector('h1') || document.body).scrollIntoView();
    requestAnimationFrame(() => scrollBy(0, -30));
  }
}, true);