-
Notifications
You must be signed in to change notification settings - Fork 0
/
background.js
34 lines (34 loc) · 1.15 KB
/
background.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
(() => {
"use strict";
chrome.runtime.onInstalled.addListener((async () => {
await chrome.storage.local.set({
auto_open: !0,
auto_solve: !0,
click_delay_time: 50,
solve_delay_time: 3e3
})
})), chrome.runtime.onMessage.addListener((function(e, t, a) {
return (async () => {
const t = `https://github.com/Wikidepia/hektCaptcha-extension/releases/download/modelhub/${e}.ort`;
try {
const e = await fetch(t),
s = await e.blob(),
o = await (async e => {
const t = new FileReader;
return new Promise((a => {
t.onloadend = () => a(t.result), t.readAsDataURL(e)
}))
})(s);
a({
status: e.status,
model: o
})
} catch (e) {
a({
status: "error",
message: e.message
})
}
})(), !0
}))
})();