Double Confirm Publish

Double confirm when you want to directly publish an article.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Double Confirm Publish
// @namespace    http://tampermonkey.net/
// @version      2023-12-12
// @description  Double confirm when you want to directly publish an article.
// @author       Tony Su
// @match        https://card.weibo.com/article/v3/editor
// @icon         https://www.google.com/s2/favicons?sz=64&domain=weibo.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    window.addEventListener('load', () => {
     setTimeout(() => {
         var saved = null;
         var replace = document.createElement('a');
         replace.classList.add("S_txt1");
         replace.textContent = '确认发布';
         replace.addEventListener('click', (event) => {
             replace.replaceWith(saved);
         });
         var a = document.querySelectorAll(".next .W_btn_a");
         for (var i = 0; i < a.length; i++) {
             if (a[i].innerHTML.trim() == "立即发布") {
                 saved = a[i];
                 a[i].replaceWith(replace);
             }
         }}, 3000);
    }, false);
})();