CSDN|简书优化

支持手机端和PC端

Stan na 13-08-2020. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         CSDN|简书优化
// @namespace    http://tampermonkey.net/
// @version      0.2.8.2
// @description  支持手机端和PC端
// @author       MT-戒酒的李白染
// @include        http*://www.csdn.net/*
// @include        http*://bbs.csdn.net/*
// @include        http*://www.jianshu.com/*
// @include        http*://blog.csdn.net/*
// @include        http*://download.csdn.net/*
// @grant        GM_addStyle
// @run-at         document-start
// @require      https://cdn.staticfile.org/jquery/1.12.4/jquery.min.js
// ==/UserScript==

(function() {
    'use strict';
    var usa = navigator.userAgent.match('Windows');
    if(usa !== null)
        {//电脑
            GM_addStyle(`
                .ecommend-item-box.recommend-recommend-box{
                    display:none;
                }
                .blog_container_aside,#nav{
                    margin-left:-45px;
                }
                .recommend-right.align-items-stretch.clearfix,.dl_right_fixed{
                    margin-left:45px;
                }
            `)
            try{localStorage.setItem("anonymousUserLimit", "");}catch(err){}
            try{csdn.copyright.textData="";}catch(err){}
            try{document.querySelector("#mainBox > aside").remove();document.querySelector("#mainBox > main").style="width:1300px;";}catch(err){}
            try{document.querySelector("#btn-readmore-zk").click();}catch(err){}
            try{document.querySelector("body > div.login-mark").style="display:none";}catch(err){}
            try{document.querySelector("#passportbox").style=("display:none");}catch(err){}
            try{document.querySelector("#dmp_ad_58").remove();}catch(err){}
            try{document.querySelector("#writeGuide").remove();}catch(err){}
            try{document.querySelector(".leftPop").remove();}catch(err){}
            try{var a = document.getElementsByClassName("recommend-item-box recommend-recommend-box");var i = 0;for(i=0;i<a.length;i++){a[i].remove();}}catch(err){}
            try{var b = document.getElementsByClassName("recommend-item-box recommend-recommend-box");var j = 0;for(i=0;i<a.length;i++){a[i].remove();}}catch(err){}
        }else
        {//手机
            if(location.href.match(/csdn.net/g)){
                console.log("csdn");
                GM_addStyle(`
                            #mainBox {
                                      width: auto;
                            }
                            #operate,.feed-Sign-span{
                                      display:none;
                            }
                `)
                
                $(document).ready(function(){
                    console.log("csdn");
                    try{document.querySelector("#article > div.readall_box > div.btn_mod > a > span").click();}catch(err){}//展开全文
                    try{document.querySelector("#new_read_more").click();}catch(err){}//关闭跳转
                    try{$(".feed-Sign-span")[0].remove()}catch(err){}
                    
                });
            }else if(location.href.match(/jianshu.com/g)){
                for(var i=0;i<2;i++){
                    console.log("简书");
                    setTimeout(function(){
                        try{document.querySelector("#jianshu-header").remove()}catch(err){}
                        try{document.querySelector("#layout-default > div.main-view > button").remove()}catch(err){}
                        try{document.querySelector("#note-show > div.note > div.content > div > div.collapse-tips > button").click()}catch(err){}
                        try{document.querySelector("#layout-default > div.main-view > div.dialog-1f6iY_0 > div > div > div > div > button.cancel").click()}catch(err){}
                        try{document.querySelector("#note-show > div.note > div:nth-child(5)").remove()}catch(err){}
                        try{var a = document.createElement("style");a.innerHTML="#recommended-notes {display:none}";document.head.appendChild(a)}catch(err){}
                        try{document.querySelector("#footer").remove()}catch(err){}
                    },0)
                }
            }
        }



})();