-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheasybib.js
More file actions
39 lines (31 loc) · 1.03 KB
/
easybib.js
File metadata and controls
39 lines (31 loc) · 1.03 KB
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
// ==UserScript==
// @name Better Easybib
// @version 0.1
// @description Close the popups
// @author Goofables
// @match https://www.easybib.com/*
// @icon https://www.google.com/s2/favicons?domain=easybib.com
// @grant none
// ==/UserScript==
function getElementsByXPath(xpath, parent) {
let results = [];
let query = document.evaluate(xpath, parent || document,
null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
for (let i = 0, length = query.snapshotLength; i < length; ++i) {
results.push(query.snapshotItem(i));
}
return results;
}
setInterval(
() => getElementsByXPath("//button[@aria-label='close dialog']")[0].click(), 100,
)
setInterval(() => {
for (const e of getElementsByXPath("//div[contains(@class,'styled__') and contains(@class, 'SideView')]")) {
e.remove();
}
for (const e of document.getElementsByClassName("styled__AdMarginWrapper-sc-11wpos5-2")) {
e.style.margin = '0';
}
},
500
)