-
Notifications
You must be signed in to change notification settings - Fork 1
/
content.js
35 lines (30 loc) · 883 Bytes
/
content.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
31
32
33
34
35
function waitForElm(selector) {
return new Promise(resolve => {
if (document.querySelector(selector)) {
return resolve(document.querySelector(selector));
}
const observer = new MutationObserver(mutations => {
if (document.querySelector(selector)) {
resolve(document.querySelector(selector));
observer.disconnect();
}
});
observer.observe(document.body, {
childList: true,
subtree: true
});
});
}
const archivedClass = ".x2lah0s";
waitForElm(archivedClass).then(async(elm) => {
try {
elm.remove()
while (true) {
const element = await waitForElm(archivedClass)
element.remove()
}
}
catch(error) {
console.log('Erro ao tentar remover elemento', error)
}
});