-
Notifications
You must be signed in to change notification settings - Fork 1
/
script.js
29 lines (25 loc) · 1.36 KB
/
script.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
(function($){
// while (null !== $('div[role="gridcell"]')){
var
step1 = function(){
$('div[role="gridcell"]').click();
setTimeout(step2, 500);},
step2 = function(){
$('div[role="gridcell"]').click();
setTimeout(step3, 500);},
step3 = function(){
$('div[aria-label="Menu"]').click();
setTimeout(step4, 300);},
step4 = function(){
var elements = document.evaluate('//div[@role="menu"]//span[contains(text(),"Delete chat")]', document, null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0; i < elements.snapshotLength; i++) {
elements.snapshotItem(i).click();}
setTimeout(step5, 500);},
step5 = function(){
var elements = document.evaluate('//div[@aria-label="Delete chat"]//div[@aria-label="Delete chat"]', document, null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0; i < elements.snapshotLength; i++) {
elements.snapshotItem(i).click();}
setTimeout(step1, 300);};
step1();
})(function(selector){ return document.querySelector(selector);
});