Bing stop now

锁定Bing,不自动到顶端

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name        Bing stop now
// @namespace   Bing页面锁定
// @description 锁定Bing,不自动到顶端
// @author      girl
// @icon        https://favicon.yandex.net/favicon/v2/bing.com
// @include     *://cn.bing.com/*
// @version     0.0.1
// @license     GPL-3.0-only
// @home-url    https://greasyfork.org/zh-CN/scripts/430997
// ==/UserScript==
//
 
(function() {
    'use strict';
     //====================================================================================
    // 禁止Bing烦人的自动返回页面顶部
    // https://greasyfork.org/zh-CN/scripts/461790-fix-for-bing-search-returns-to-the-top
    // Disable the scroll to top functionality
    function disableScrollToTop() {
        let originalFunc = window.scrollTo;
        window.scrollTo = function(x, y) {
            if (y !== 0) {
                originalFunc(x, y);
            }
        };
    }
 
    // Listen for 'focus' events on the window
    window.addEventListener('focus', disableScrollToTop);
    //====================================================================================
})();