Just Read

Simplify your reading experience

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Just Read
// @description  Simplify your reading experience
// @license      MIT
// @homepageURL  https://github.com/isolcat/JustRead
// @match        https://www.zhihu.com/**
// @version      0.2.1
// @namespace    https://github.com/isolcat
// ==/UserScript==


const topstoryElement = document.querySelector('.Topstory');
const creators = document.querySelector('.css-1oy4rvw');
const elements = document.querySelectorAll('.Card.TopstoryItem.TopstoryItem-isRecommend');
const content = document.querySelector('.Topstory-mainColumn')
const questionList = document.querySelector('.QuestionAnswers-answers')
const videoTab = document.querySelectorAll('.TopstoryTabs-link.Topstory-tabsLink')
const searchHot = document.querySelector('.css-1oy4rvw')
const zhiUrl = window.location.href


if (zhiUrl.includes('question')) {
    creators.remove()
    questionList.style.margin = '0 auto'
} else if (zhiUrl.includes('search')) {
    searchHot.remove()
} else {
    content.style.margin = '0 auto'
    content.style.width = '960px'
    videoTab[3].style.display = 'none';
}


content.style.margin = '0 auto'
content.style.width = '960px'

if (topstoryElement) {
    topstoryElement.querySelector('div')?.remove();
}

if (creators) {
    creators.remove();
}

function removeElement() {
    var elements = document.querySelectorAll('.css-i2yo90');
    elements.forEach(function (element) {
        var parentElement = element.closest('.Card.TopstoryItem.TopstoryItem-isRecommend');
        if (parentElement) {
            parentElement.remove();
        }
    });
}

setInterval(removeElement, 100);