fix #6
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cap.js/widget",
|
||||
"version": "0.0.19",
|
||||
"version": "0.0.20",
|
||||
"description": "Cap widget",
|
||||
"keywords": [
|
||||
"captcha",
|
||||
|
||||
+10
-7
@@ -138,15 +138,16 @@
|
||||
})
|
||||
).json();
|
||||
|
||||
if (!resp.success) throw new Error("Invalid solution");
|
||||
|
||||
this.dispatchEvent("progress", { progress: 100 });
|
||||
this.dispatchEvent("solve", { token: resp.token });
|
||||
this.#token = resp.token;
|
||||
|
||||
if (!resp.success) throw new Error("Invalid solution");
|
||||
if (this.querySelector("input[name='cap-token']")) {
|
||||
this.querySelector("input[name='cap-token']").value = resp.token;
|
||||
}
|
||||
|
||||
this.dispatchEvent("solve", { token: resp.token });
|
||||
this.#token = resp.token;
|
||||
|
||||
if (this.#resetTimer) clearTimeout(this.#resetTimer);
|
||||
const expiresIn = new Date(resp.expires).getTime() - Date.now();
|
||||
if (expiresIn > 0 && expiresIn < 24 * 60 * 60 * 1000) {
|
||||
@@ -225,8 +226,8 @@
|
||||
const maxWorkers = Math.min(navigator.hardwareConcurrency || 8, 16);
|
||||
this.#workersCount =
|
||||
!isNaN(parsedWorkers) &&
|
||||
parsedWorkers > 0 &&
|
||||
parsedWorkers <= maxWorkers
|
||||
parsedWorkers > 0 &&
|
||||
parsedWorkers <= maxWorkers
|
||||
? parsedWorkers
|
||||
: navigator.hardwareConcurrency || 8;
|
||||
}
|
||||
@@ -424,7 +425,9 @@
|
||||
typeof WebAssembly.instantiate === "function"
|
||||
)
|
||||
) {
|
||||
console.log("[cap] WASM not enabled, falling back to crypto.subtle\nThis is significanty slower than the WASM implementation");
|
||||
console.log(
|
||||
"[cap] WASM not enabled, falling back to crypto.subtle\nThis is significanty slower than the WASM implementation"
|
||||
);
|
||||
|
||||
const targetBytes = new Uint8Array(target.length / 2);
|
||||
for (let k = 0; k < targetBytes.length; k++) {
|
||||
|
||||
Reference in New Issue
Block a user