csdn close notice

try to take over the world!

Från och med 2019-01-02. Se den senaste versionen.

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         csdn close notice
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://blog.csdn.net/*
// @grant        none
// ==/UserScript==

(async function() {
    'use strict';

    function sleep(ms) {
        return new Promise(resolve => setTimeout(resolve, ms));
    }

    var a = $(".btn-close");
    var m = $("#btn-readmore");

    var counter = 0;
    while (a.length == 0 || m.length == 0) {
        await sleep(2000);
        counter ++;
        if (counter > 16) {
            console.log('Waited 32 seconds, exiting...');
            return -1;
        }
        console.log("Length: a:", a.length, "m:", m.length);
    }

    for (var i = 0; i < a.length; i++) {
        a[i].click();
    }
    console.log("a clicked");
    m[0].click()
    console.log("m clicked");

    console.log("All Btns Clicked");
    return 0;
})();