-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcycleDeleteWithClick.js
30 lines (27 loc) · 1.59 KB
/
cycleDeleteWithClick.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//循环点击按钮删除
for (let i = 0,
len =
location.pathname.includes('home') ? document.querySelectorAll('.WB_cardwrap.WB_feed_type.S_bg2.WB_feed_like').length :
location.pathname.includes('profile') ? document.querySelectorAll('.WB_cardwrap.WB_feed_type.S_bg2.WB_feed_like').length :
location.pathname.includes('fans') ? document.querySelectorAll('.follow_item.S_line2').length:
location.pathname.includes('follow') ? document.getElementsByClassName('member_li S_bg1').length: 0
; i < len; i++) {
setTimeout(batchClick, 2000 * i);
}
function batchClick() {
if (location.pathname.includes('home')||location.pathname.includes('profile')) {//我的主页
document.querySelector('a[action-type="fl_menu"]').click();
document.querySelector('a[title="删除此条微博"]').click();
document.querySelector('a[action-type="ok"]').click();
} else if (location.pathname.includes('fans')) {//粉丝
document.querySelector('div[node-type="layer_menu_list"]').style.display='block';
document.querySelector('a[action-type="removeFan"]').click();
document.querySelector('.W_btn_a').click();
} else if (location.pathname.includes('follow')) {//我的关注
document.querySelector('div[node-type="layer_hover_list"]').style.display='block';
document.querySelector('a[action-type="cancel_follow_single"]').click();
document.querySelector('.W_btn_a').click();
}
chrome.runtime.sendMessage({ type: "deleteByClickFinish" });
}
//@ sourceURL=cycleDeleteWithClick.js