Wechat Push Alert

Wechat Push Alert before you push the article

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Wechat Push Alert
// @namespace    https://github.com/Cloudiiink/WechatPushAlert
// @version      0.2
// @description  Wechat Push Alert before you push the article
// @author       Cloudiiink
// @include      *://mp.weixin.qq.com/*
// @grant        none
// ==/UserScript==

// let the page wait
function sleep(milliseconds) {
    var start = new Date().getTime();
    for (var i = 0; i < 1e7; i++) {
        if ((new Date().getTime() - start) > milliseconds){
            break;
        }
    }
}

(function() {
    'use strict';
    // 检查页面内是否有群发按钮
    if (document.getElementById('send_btn_main') != null) {
        // Add check button
        var checkbtn = document.createElement("input");
        checkbtn.setAttribute("type", "button");
        checkbtn.setAttribute("value", "推前检查");
        checkbtn.style.display = "inline-block";
        checkbtn.style.borderRadius = "3px";
        checkbtn.style.height = "32px";
        checkbtn.style.width = "110px";
        checkbtn.style.align = "center";
        checkbtn.style.marginLeft = "14px";
        checkbtn.style.marginBottom = "10px";
        checkbtn.style.background = "#e82f28";
        checkbtn.style.color = "white";
        document.getElementById("send_tips_main").appendChild(checkbtn)

        // button event
        checkbtn.addEventListener("click", function() {
            if (confirm("我们的文章原创标了么?") === true) {
                sleep(400);
                if (confirm("转载的格式都对么?") === true) {
                    sleep(400);
                    if (confirm("推前大佬们确认过了么?") === true) {
                        sleep(400);
                        if (confirm("要修改的地方全都改了么?") === true) {
                            sleep(400);
                            if (confirm("看一眼昨天的推送,真的什么都没有落下了?") === true) {
                                sleep(400);
                                if (confirm("以防万一,再点进预览里看一眼吧!") === true) {
                                    sleep(400);
                                    if (confirm("真的啥问题都没了!") === true) {
                                        sleep(400);
                                        alert("勇敢地去点下那个群发按钮吧!没什么好怕的了!");
                                    }
                                }
                            }
                        }
                    }
                }
            }
        });
    }
})();