[Twitter] Fix scroll

My very crude attempt at fixing twitter scrolling to top of page on moving back from sub-tweets.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey 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 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         [Twitter] Fix scroll
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  My very crude attempt at fixing twitter scrolling to top of page on moving back from sub-tweets.
// @author       SL1900
// @match        *://*.twitter.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=twitter.com
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    let session_store = {};

    setInterval(()=>{
        if(window.scrollY < 50 && session_store[window.location.href] && session_store[window.location.href] > 300)
        {
            console.log(session_store[window.location.href]);
            window.scroll(window.scrollX, session_store[window.location.href]);
        }

        if(window.scrollY > 150) session_store[window.location.href] = window.scrollY;
    }, 100);
})();