Wechat Push Alert

Wechat Push Alert before you push the article

  1. // ==UserScript==
  2. // @name Wechat Push Alert
  3. // @namespace https://github.com/Cloudiiink/WechatPushAlert
  4. // @version 0.2
  5. // @description Wechat Push Alert before you push the article
  6. // @author Cloudiiink
  7. // @include *://mp.weixin.qq.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. // let the page wait
  12. function sleep(milliseconds) {
  13. var start = new Date().getTime();
  14. for (var i = 0; i < 1e7; i++) {
  15. if ((new Date().getTime() - start) > milliseconds){
  16. break;
  17. }
  18. }
  19. }
  20.  
  21. (function() {
  22. 'use strict';
  23. // 检查页面内是否有群发按钮
  24. if (document.getElementById('send_btn_main') != null) {
  25. // Add check button
  26. var checkbtn = document.createElement("input");
  27. checkbtn.setAttribute("type", "button");
  28. checkbtn.setAttribute("value", "推前检查");
  29. checkbtn.style.display = "inline-block";
  30. checkbtn.style.borderRadius = "3px";
  31. checkbtn.style.height = "32px";
  32. checkbtn.style.width = "110px";
  33. checkbtn.style.align = "center";
  34. checkbtn.style.marginLeft = "14px";
  35. checkbtn.style.marginBottom = "10px";
  36. checkbtn.style.background = "#e82f28";
  37. checkbtn.style.color = "white";
  38. document.getElementById("send_tips_main").appendChild(checkbtn)
  39.  
  40. // button event
  41. checkbtn.addEventListener("click", function() {
  42. if (confirm("我们的文章原创标了么?") === true) {
  43. sleep(400);
  44. if (confirm("转载的格式都对么?") === true) {
  45. sleep(400);
  46. if (confirm("推前大佬们确认过了么?") === true) {
  47. sleep(400);
  48. if (confirm("要修改的地方全都改了么?") === true) {
  49. sleep(400);
  50. if (confirm("看一眼昨天的推送,真的什么都没有落下了?") === true) {
  51. sleep(400);
  52. if (confirm("以防万一,再点进预览里看一眼吧!") === true) {
  53. sleep(400);
  54. if (confirm("真的啥问题都没了!") === true) {
  55. sleep(400);
  56. alert("勇敢地去点下那个群发按钮吧!没什么好怕的了!");
  57. }
  58. }
  59. }
  60. }
  61. }
  62. }
  63. }
  64. });
  65. }
  66. })();