移除知乎、简书、freebuf标题

移除知乎、简书、freebuf标题|方便划水!

目前为 2021-01-07 提交的版本。查看 最新版本

// ==UserScript==
// @name        移除知乎、简书、freebuf标题
// @namespace   phant0ms.me
// @version      0.3
// @description  移除知乎、简书、freebuf标题|方便划水!
// @author       phant0ms
// @include      *.zhihu.com/*
//@include       *.freebuf.com/*
//@include       *.jianshu.com/*
// @grant        none
// @run-at document-end
// ==/UserScript==

(function () {
    'use strict';
    window.onload = function () {
        var url = window.location.href;
        if (url.search("zhihu.com")>-1) {
            //知乎标题移除
            // var title = document.querySelector(".PageHeader");
            var title = document.querySelector("#root > div > div:nth-child(2) > header");
            if (title) {
                title.remove();
                console.log("title removed success");
            }
            else {
                console.log("not found zhihu titile");
            }
        }
        else if (url.search("freebuf.com")>-1) {
            //freebuf标题移除
            var freebuf = document.querySelector("#artical-detail-page > div.page-header");
            if (freebuf) {
                freebuf.remove();
                console.log("title removed success");
            }
            else {
                console.log("not found freebuf title");
            }
        }
        else if (url.search("jianshu.com")>-1) {
            //简书
            var jianshu = document.querySelector('._1CSgtu');
            if (jianshu) {
                jianshu.remove();
                console.log("title removed success");
            }
            else {
                console.log("not found jianshu title");
            }
        }

    }

})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址