-
Notifications
You must be signed in to change notification settings - Fork 0
/
fb_delete_allgroupmembers.js
27 lines (23 loc) · 1.02 KB
/
fb_delete_allgroupmembers.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
// Javascript code to iterate through all group members and delete them automatically.
deleteAll = [];
deleteAll.elms = [];
deleteAll.elms = document.getElementsByClassName("uiPopoverButton _p uiButton uiButtonSuppressed uiButtonNoText");
function deleteMembers(dUser){
if (dUser < 1)
throw new Error("Don't delete the last user which in my case is the administrator");
setTimeout(function(){
document.getElementsByClassName("uiPopoverButton _p uiButton uiButtonSuppressed uiButtonNoText")[dUser].click()
}, 500);
setTimeout(function(){
document.getElementsByClassName("_54nc")[1].click()
}, 3000);
setTimeout(function(){
document.getElementsByClassName("_42ft _42fu layerConfirm uiOverlayButton selected _42g- _42gy")[0].click()
}, 3000);
setTimeout(function(){
node = document.getElementsByClassName('uiContextualLayerPositioner uiLayer hidden_elem')[0];
node.parentNode.removeChild(node);
}, 4000);
setTimeout(function() { deleteMembers(dUser - 1); }, 5000)
}
deleteMembers(deleteAll.elms.length-1);