csdn close notice

try to take over the world!

Tính đến 02-01-2019. Xem phiên bản mới nhất.

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

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

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.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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;
})();