Wechat article desktop layout

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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