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

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

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

  1. // ==UserScript==
  2. // @name 微信文章桌面排版 | Wechat article desktop layout
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description 使文章撑满整个屏幕。消除手机排版横向文字过少的问题。Expand the article width to fit the screen.
  6. // @author thundermikey
  7. // @match https://mp.weixin.qq.com/s/*
  8. // @grant none
  9. // @source https://github.com/ThunderMikey/wechat-article-desktop-layout
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // max width of the main article body
  16. // pass "none" to fit the screen width
  17. // e.g. set_max_width("none");
  18. set_max_width("1200px");
  19.  
  20. // hide QR code which might obstruct the article
  21. hide_qr_code();
  22. })();
  23.  
  24. function set_max_width(maxWidth){
  25. var richMediaContent = document.querySelector("#page-content > div");
  26. richMediaContent.style.maxWidth=maxWidth;
  27. };
  28.  
  29. function hide_qr_code(){
  30. document.querySelector("#js_pc_qr_code").style.visibility="hidden";
  31. };