优化微信文章

修复了一些微信文章问题

目前为 2023-09-09 提交的版本。查看 最新版本

// ==UserScript==
// @name        优化微信文章
// @name:en         FuckweixinArticle
// @namespace    https://gf.qytechs.cn/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/*
// @grant        GM_setValue
// @grant        GM_getValue
// @icon //res.wx.qq.com/a/wx_fed/assets/res/NTI4MWU5.ico
// @version      3.0
// @license Mozilla
// ==/UserScript==
(function() {
    'use strict';
    var t = GM_getValue('lastClickTime', 0);
    var o = new MutationObserver(function(mL) {
        mL.forEach(function(m) {
            if (m.target.id === 'js_link_dialog_body') {
                var c = Date.now();
                if (c - t < 1e3) return;
                GM_setValue('lastClickTime', c);
                var a = document.getElementById('js_link_dialog_ok');
                if (a) a.click();
                var l = document.getElementById('js_link_dialog_cancel');
                if (l) l.addEventListener('click', function(e) { e.preventDefault(); });
                m.target._processed = true;
            }
        });
    });
    o.observe(document.body, { childList: true, subtree: true });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址