Eink-Zhihu

Keep only main content in zhihu

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Eink-Zhihu
// @namespace    https://greasyfork.org/users/169007
// @version      1.4.6
// @description  Keep only main content in zhihu
// @author       ZZYSonny
// @match        https://www.zhihu.com/*
// @grant        none
// @run-at       document-start
// ==/UserScript==
(function () {
    'use strict';
    const head = document.getElementsByTagName('head')[0];
    const exGlobalStyle = document.createElement('style');
    const M = [
        [
            [
                ".VideoAnswerPlayer",
                ".CornerButtons",
                ".AppHeader",
                ".QuestionHeader",
                ".Question-sideColumn",
                ".GlobalSideBar",
                ".Reward",
                ".Catalog",
                ".Sticky",
                ".MCNLinkCard",
                ".Topstory > div:not(.Topstory-container)"
            ], c => `${c}{display: none;}`
        ], [
            [
                ".Question-main",
                ".Question-mainColumn",
                ".Topstory-container",
                ".Topstory-mainColumn"
            ],c => `${c}{width:100%;padding:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;}`
        ], [
            ["figure"],
            c => `${c}{width: 50%;padding-left:25%;pointer-events:none;}`
        ]
    ];
    exGlobalStyle.type = 'text/css';
    exGlobalStyle.innerHTML = M.flatMap(p => p[0].map(p[1])).join("\n");
    head.appendChild(exGlobalStyle);
})();