Greasy Fork

2022京东淘宝自动领红包

自动领取618红包

// ==UserScript==
// @name         2022京东淘宝自动领红包
// @namespace    http://tampermonkey.net/
// @version      0.6
// @description  自动领取618红包
// @author       You
// @match        https://prodev.jd.com/mall/active/3RiABUPHkTTz7sGcEFowgMMytyc1/index.html?*
// @match        https://prodev.m.jd.com/mall/active/31e6keDr2FdaUEVSvNZM2kjD7QVx/index.html?*
// @match        https://pages.tmall.com/wow/z/lianmeng/default/route-lianmeng-index?*
// @license      MIT License
// @grant        none
// ==/UserScript==

window.onload = function() {
    setTimeout(function() {
        try {
            if(location.href.substr(8,6) == 'prodev') window.open('https://s.click.taobao.com/VOVhAXu');
            if(location.href.substr(15,1) != 'm') location.href = "https://u.jd.com/ldgSxVn";       
            document.getElementsByClassName("index-module__union-coupon-button___1grbK union-main-receive-btn index-module__animate-pulse___YnSfN")[0].click();
        } catch(err){
            document.getElementsByClassName("mm_wf_scale J_click_proxy")[0].click();
            setTimeout(function() {window.close()}, 1000);
        }
    }, 1000)
}