vince_ding / 知乎隐藏头部和侧边

// ==UserScript==
// @name  知乎隐藏头部和侧边
// @namespace  vince.zhihu
// @include *://zhihu.com
// @include *://www.zhihu.com/*
// @description:zh-cn 隐藏知乎的头部固定标题和右侧固定侧边栏,显示全部回复
// @version 2.1.0
// @license MIT 
// @description 隐藏知乎的头部固定标题和右侧固定侧边栏,显示全部回复
// ==/UserScript==

function startScript(){
    var idx =0;
    var isall=document.querySelector(".QuestionMainAction");
    if(isall){
        isall.click();
    }

    var statuss = document.getElementsByClassName("AppHeader");
    if(statuss){
        for ( idx = 0; idx < statuss.length; idx++) {
            statuss[idx].style.position='unset';
        }
    }
    if(statuss){
        statuss = document.getElementsByClassName("Question-sideColumn");
        for ( idx = 0; idx < statuss.length; idx++) {
            statuss[idx].style.display='none';
        }
    }
    var TitleImageimagefull= document.getElementsByClassName("TitleImage-image--full");
    if(TitleImageimagefull){
        for ( idx = 0; idx < TitleImageimagefull.length; idx++) {
            TitleImageimagefull[idx].style.height="150px";
            TitleImageimagefull[idx].style.backgroundPosition="bottom";
        }
    }

    var TitleImageimagePurefixed= document.getElementsByClassName("TitleImage-imagePure--fixed");
    if(TitleImageimagePurefixed){
        var TitleImage= document.getElementsByClassName("TitleImage");
        if(TitleImage){
            for ( idx = 0; idx < TitleImage.length; idx++) {
                TitleImage[idx].style.display="none";
            }
        }
    }
    var Layoutmain= document.getElementsByClassName("Layout-main");
    if(Layoutmain){
        for ( idx = 0; idx < Layoutmain.length; idx++) {
            Layoutmain[idx].style.width="100%";
            Layoutmain[idx].style.marginLeft="15px";
        }
    }
    var Questionmain= document.getElementsByClassName("Question-main");
    if(Questionmain){
        for ( idx = 0; idx < Questionmain.length; idx++) {
            Questionmain[idx].style.width="100%";
        }
    }
    var maincon= document.getElementsByClassName("Question-mainColumn");
    if(maincon){
        for ( idx = 0; idx < maincon.length; idx++) {
            maincon[idx].style.width="100%";
        }
    }
    var topscon=document.getElementsByClassName("Topstory-mainColumn");
    if(topscon){
        for ( idx = 0; idx < topscon.length; idx++) {
            if(topscon[idx].nextSibling){
                topscon[idx].nextSibling.style.display='none';
            }
            topscon[idx].style.width="100%";
        }
    }
    var TopstoryContainer=document.getElementsByClassName("Topstory-container");
    if(TopstoryContainer){
        for ( idx = 0; idx < TopstoryContainer.length; idx++) {
            TopstoryContainer[idx].style.width="100%";
        }
    }
    var TopstoryMain=document.getElementsByClassName("TopstoryMain");
    if(TopstoryMain){
        for ( idx = 0; idx < TopstoryMain.length; idx++) {
            TopstoryMain[idx].style.width="100%";
        }
    }
    var ProfilesideColumn=document.getElementsByClassName("Profile-sideColumn");
    if(ProfilesideColumn){
        for ( idx = 0; idx < ProfilesideColumn.length; idx++) {
            ProfilesideColumn[idx].style.display='none';
        }
    }

    var ProfilemainColumn=document.getElementsByClassName("Profile-mainColumn");
    if(ProfilemainColumn){
        for ( idx = 0; idx < ProfilemainColumn.length; idx++) {
            ProfilemainColumn[idx].style.width="100%";
        }
    }
}
startScript();