FIX for "Bing Search returns to the top" !

Stop doing weird things, Bing ;)

  1. // ==UserScript==
  2. // @name FIX for "Bing Search returns to the top" !
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.20.3
  5. // @description Stop doing weird things, Bing ;)
  6. // @author Geekness
  7. // @match http*://*.bing.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=bing.com
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // Disable the scroll to top functionality
  17. function disableScrollToTop() {
  18. const originalScrollTo = window.scrollTo;
  19. window.scrollTo = function(x, y) {
  20. if (y !== 0) {
  21. originalScrollTo.call(window, x, y);
  22. }
  23. };
  24. }
  25.  
  26. // Listen for 'focus' events on the window
  27. window.addEventListener('focus', disableScrollToTop);
  28. })();