您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
修复了一些微信文章问题
// ==UserScript== // @name 优化微信文章 // @name:en FuckweixinArticle // @namespace https://greasyfork.org/en/users/572221-alan636 // @description 修复了一些微信文章问题 // @description:en Open target link in a new tab without confirmation dialog and close the original dialog // @description:zh 修复了一些微信文章问题 // @match https://mp.weixin.qq.com/* // @author alan636 // @icon //res.wx.qq.com/a/wx_fed/assets/res/NTI4MWU5.ico // @version 4.0 // @license Mozilla // ==/UserScript== (function() { 'use strict'; var semaphore = false; var observer = new MutationObserver(function(mutationsList) { mutationsList.forEach(function(mutation) { if (mutation.target.id === 'js_link_dialog_body' && mutation.target.style.display === '' && !semaphore) { semaphore = true; preventOriginalPageRedirect(); simulateAllowButtonClick(); setTimeout(function() { semaphore = false; }, 1000); } }); }); var targetNode = document.body; var config = { childList: true, subtree: true }; observer.observe(targetNode, config); function simulateAllowButtonClick() { var allowButton = document.getElementById('js_link_dialog_ok'); if (allowButton) allowButton.click(); } function preventOriginalPageRedirect() { var linkDialogCancel = document.getElementById('js_link_dialog_cancel'); if (linkDialogCancel) linkDialogCancel.addEventListener('click', function(event) { event.preventDefault(); }); } })();