Wechat Article Menu

Wechat Article Menu, Show Some Useful Options.

目前為 2025-03-20 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 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 Menu
// @name:zh-CN         微信公众号阅读助手
// @description        Wechat Article Menu, Show Some Useful Options.
// @description:zh-CN  微信公众号文章菜单选项,展示一些有用的选项。
// @namespace          https://www.runningcheese.com
// @version            1.2
// @author             RunningCheese
// @match              https://mp.weixin.qq.com/s/*
// @match              https://mp.weixin.qq.com/s?*
// @run-at             document-start
// @icon               https://t1.gstatic.cn/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://mp.weixin.qq.com
// @license            MIT
// ==/UserScript==

javascript:(function(){'use strict';(function(){const e=document.createElement('div');e.style.cssText='position:fixed;top:12%;left:20%;transform:translate(-50%,0);background:#fff;border:none;border-radius:8px;padding:4px;width:200px;box-shadow:0 4px 12px rgba(0,0,0,0.25);z-index:999999;cursor:move;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif';let t=0,n=0,o=0,i=0,s=!1;e.onmousedown=l=>{s=!0;t=l.clientX;n=l.clientY;o=e.offsetLeft;i=e.offsetTop;e.style.transform='translateX(-50%)'};document.onmousemove=l=>{if(!s)return;const d=l.clientX-t,r=l.clientY-n;e.style.left=o+d+'px';e.style.top=i+r+'px'};document.onmouseup=()=>s=!1;let lastEscTime=0;document.addEventListener('keydown',function(evt){if(evt.key==='Escape'){const now=Date.now();if(now-lastEscTime<=300){e.remove()}lastEscTime=now}});const l=[{title:'▼ 微信阅读助手 ×',isTitle:true},{title:'1、原始链接',code:'prompt(\'原始链接:\', \'https://mp.weixin.qq.com/s?__biz=\'+biz+\'&idx=1&mid=\'+mid+\'&sn=\'+sn)'},{title:'2、文章摘要',code:'summary = document.querySelector(\'meta[name="description"]\').content; prompt(\'文章摘要:\',summary)'},{title:'3、文章封面',code:'const cover = document.querySelector(\'meta[property="twitter:image"]\').content; window.open(cover, "_blank");'},{title:'4、历史消息链接',code:'prompt(\'历史消息链接:\',\'https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=\'+biz+\'#wechat_redirect\')'},{title:'5、查看所有图片',code:'const images = Array.from(document.querySelectorAll("img")).filter(img => (img.src || img.dataset.src) && !(img.src && img.src.startsWith("data:image/svg+xml")) && !(img.dataset.src && img.dataset.src.startsWith("data:image/svg+xml"))); if(images.length === 0) { alert("未找到图片"); return; } const win = window.open("", "_blank"); win.document.write("<html><head><title>网页所有图片</title><style>body{margin:20px auto;font-family:sans-serif;max-width:700px;}img{max-width:100%;margin:10px 0;border:1px solid #eee;padding:5px;}</style></head><body><h2>网页所有图片("+images.length+"张)</h2>"); images.forEach((img, i) => { const src = img.src || img.dataset.src; win.document.write(`<p>${i+1}.</p><img src="${src}" />`); }); win.document.write("</body></html>"); win.document.close();'}];l.forEach((t,idx)=>{const n=document.createElement('div');n.style.cssText=t.isTitle?'display:flex;justify-content:space-between;align-items:center;padding:4px 10px;font-size:14px;color:#333;border-bottom:1px solid #eee;margin-bottom:2px':'cursor:pointer;padding:4px 10px;transition:all 0.2s ease;border-radius:6px;font-size:14px;color:#333;display:flex;align-items:center';if(t.isTitle){const o=document.createElement('span');o.textContent='×';o.style.cssText='cursor:pointer;color:#999;width:20px;height:20px;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:all 0.2s ease';o.onmouseover=()=>o.style.backgroundColor='#dadada';o.onmouseout=()=>o.style.backgroundColor='';o.onclick=()=>e.remove();n.textContent=t.title.replace(' ×','');n.appendChild(o)}else{n.textContent=t.title;n.onmouseover=()=>n.style.backgroundColor='#dadada';n.onmouseout=()=>n.style.backgroundColor='';if(t.url||t.code){n.onclick=o=>{o.preventDefault();if(t.url){window.open(t.url+encodeURIComponent(window.getSelection().toString()||''))}else if(t.code){try{const func=new Function(`return (function(){${t.code}})();`);func();}catch(err){console.error('执行代码时出错:',err);}}}}}e.appendChild(n)});document.body.appendChild(e)})();})();