微信文章桌面排版 | Wechat article desktop layout

使文章撑满整个屏幕。消除手机排版横向文字过少的问题。Expand the article width to fit the screen.

当前为 2019-08-12 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         微信文章桌面排版 | Wechat article desktop layout
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  使文章撑满整个屏幕。消除手机排版横向文字过少的问题。Expand the article width to fit the screen.
// @author       thundermikey
// @match        https://mp.weixin.qq.com/s/*
// @grant        none
// @source       https://github.com/ThunderMikey/wechat-article-desktop-layout
// ==/UserScript==

(function() {
    'use strict';

    // max width of the main article body
    // pass "none" to fit the screen width
    // e.g. set_max_width("none");
    set_max_width("1200px");

    // hide QR code which might obstruct the article
    hide_qr_code();
})();

function set_max_width(maxWidth){
    var richMediaContent = document.querySelector("#page-content > div");
    richMediaContent.style.maxWidth=maxWidth;
};

function hide_qr_code(){
    document.querySelector("#js_pc_qr_code").style.visibility="hidden";
};