Greasy Fork

Greasy Fork is available in English.

知乎手机页面优化

知乎手机页面优化,自动展开,无APP提示

当前为 2020-01-30 提交的版本,查看 最新版本

// ==UserScript==
// @name         知乎手机页面优化
// @namespace    http://greasyfork.icu/users/439775
// @version      0.1
// @description  知乎手机页面优化,自动展开,无APP提示
// @author       EricSong
// @match        http*://www.zhihu.com/question/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    // 自动展开
    document.querySelectorAll('.RichContent.is-collapsed')
        .forEach(n => {
            n.firstElementChild.style.removeProperty('max-height');
            n.classList.remove('is-collapsed');
        });

    // 移除App打开按钮
    document.querySelector('.OpenInAppButton').remove();

    // 移除手机modal
    document.querySelector('.MobileModal-wrapper').remove();
    document.querySelector('body').style.removeProperty('overflow');
})();