Greasy Fork

Greasy Fork is available in English.

Bing首页优化

Bing首页优化,去除bing首页的国内版和国际版切换标签,去除底部的版权信息和广告链接,保留首页壁纸切换按钮。

目前为 2021-08-18 提交的版本,查看 最新版本

// ==UserScript==
// @author      girl
// @icon        https://favicon.yandex.net/favicon/v2/bing.com
// @name        Bing首页优化
// @namespace   Bing首页优化
// @description Bing首页优化,去除bing首页的国内版和国际版切换标签,去除底部的版权信息和广告链接,保留首页壁纸切换按钮。
// @include     *://cn.bing.com/
// @version     1.0.0
// ==/UserScript==
//


(function() {

  var timeFunction = window.setInterval(function(){loadEnd()},200);
  function loadEnd(){
        var footer = document.querySelector('#footer');//est_switch
        var searchNav = document.querySelector('#est_switch');
        var searchBox = document.querySelector('#sb_form_q');
        var sbox = document.querySelector('.sbox');
        if(footer){
          hidenDom(footer);
        }
        if(searchNav){
          hidenDom(searchNav);
        }
        if(searchBox){
          searchBox.onclick=function(){hidenDom(searchNav);};
          searchBox.onfocus=function(){hidenDom(searchNav);};
          searchBox.onblur=function(){hidenDom(searchNav);};
          searchBox.onmousedown=function(){hidenDom(searchNav);};
          //searchBox.parentElement.style.backgroundColor = "#FFFFFFa0";
          //searchBox.style.backgroundColor  = "#FFFFFF00";
        }
        if(sbox){
          sbox.style.margin='0';
            sbox.style.top = "30%"; // 设置位置
            sbox.style.left = "30%";
          }
        }
        function removeDom(dom){
          if(dom){
            dom.remove();
          }
        }
        function hidenDom(dom){
          if(dom){
            dom.style.display = 'none';
          }
        }
  })();