Greasy Fork 还支持 简体中文。

知乎优化

Sets custom widths and hides specified elements on Zhihu

目前為 2025-03-22 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         知乎优化
// @namespace    http://tampermonkey.net/
// @version      0.6
// @description  Sets custom widths and hides specified elements on Zhihu
// @author       You
// @match        https://www.zhihu.com/*
// @match        http://www.zhihu.com/*
// @match        https://zhihu.com/*
// @match        http://zhihu.com/*
// @grant        none
// @license MIT
// @run-at       document-start
// ==/UserScript==
(function() {
    'use strict';
    
    // 创建样式表
    const style = document.createElement('style');
    style.textContent = `
        .Topstory-mainColumn, .Question-mainColumn {
            width: 100% !important;
        }
        
        .css-11p8nt5, .css-1kjxdzv {
            max-width: 0px !important;
            min-width: 950px !important;
        }
        
        .Question-sideColumn {
            display: none !important;
        }
        
        .css-1qyytj7 > div,
        .css-29q9fa,
        li.Tabs-item--noMeta.AppHeader-Tab.Tabs-item:nth-of-type(3),
        li.Tabs-item--noMeta.AppHeader-Tab.Tabs-item:nth-of-type(4),
        .css-18vqx7l > .fEPKGkUK5jyc4fUuT0QP.Button--plain.FEfUrdfMIKpQDJDqkjte.css-79elbk.Button {
            display: none !important;
        }
    `;
    
    // 在页面开始加载时就插入样式
    document.documentElement.appendChild(style);
})();