百度首页取消推荐

百度首页取消推荐0.1

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         百度首页取消推荐
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  百度首页取消推荐0.1
// @author       [email protected]
// @match        https://www.baidu.com/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=baidu.com

// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    if(location.href=='https://www.baidu.com/')
    {
       let tuijian = document.querySelector('#s_menus_wrapper span[data-id="99"]');
       if(tuijian.classList.contains('current')){
            //alert('包含 current 这个class');
            let guanzhu = document.querySelector('#s_menus_wrapper span[data-id="100"]');

            let s_menu_mine = document.getElementById('s_menu_mine');
            //console.log(s_menu_mine);
            //s_menu_mine.click();
            setTimeout("document.getElementById('s_menu_mine').click()",500);



            //s_content_100.style.display="block";
            //let s_content_2 = document.querySelector('#s_content_2');
            //console.log(s_content_2);
            //s_content_2.style.display="none";
            //console.log(guanzhu);



       }

    }

})();