微信文章桌面排版

使文章撑满整个屏幕。消除手机排版横向文字过少的问题。

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

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