-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathairlink.js
25 lines (25 loc) · 813 Bytes
/
airlink.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
(function () {
setTimeout(function enable() {
try {
document.querySelector("a.navigation-pane__link--settings").click();
document.querySelector("ul > div:nth-child(5) > li > a").click();
setTimeout(() => {
if (
!document
.querySelector("#AirLink + span")
.className.includes("checked")
) {
document.querySelector("#AirLink").click();
// lets close the window on autorun
require('electron').remote.BrowserWindow.getFocusedWindow().close();
} else {
// if airlink enabled, manual open, return to home
document.querySelector("a.navigation-pane__link--home").click();
}
}, 1000);
} catch (e) {
console.error(e);
setTimeout(enable, 1000);
}
}, 1000);
})();