feat: widget@0.1.33
This commit is contained in:
+2
-2
@@ -49,7 +49,7 @@ const browser = await chromium.launch({ headless: false });
|
||||
const page = await browser.newPage();
|
||||
|
||||
const server = Bun.serve({
|
||||
port: 3000,
|
||||
port: 3006,
|
||||
routes: {
|
||||
"/": () => {
|
||||
return new Response(Bun.file("./test.html"));
|
||||
@@ -87,4 +87,4 @@ const server = Bun.serve({
|
||||
},
|
||||
});
|
||||
|
||||
page.goto(`http://localhost:3000/`);
|
||||
page.goto(`http://localhost:3006/`);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# Cap Widget
|
||||
# [@cap.js](https://capjs.js.org)/widget
|
||||
|
||||
For docs, see [capjs.js.org](https://capjs.js.org/guide/widget.html)
|
||||
Client-side widget for Cap, the self-hosted CAPTCHA for the modern web.
|
||||
|
||||
**[Learn more](https://github.com/tiagozip/cap)**
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cap.js/widget",
|
||||
"version": "0.1.32",
|
||||
"version": "0.1.33",
|
||||
"description": "Client-side widget for Cap, a lightweight, modern open-source CAPTCHA alternative designed using SHA-256 PoW.",
|
||||
"keywords": [
|
||||
"security",
|
||||
|
||||
+1
-15
@@ -292,22 +292,9 @@
|
||||
return;
|
||||
}
|
||||
|
||||
const timeout = setTimeout(() => {
|
||||
try {
|
||||
worker.terminate();
|
||||
workers[workerId] = new Worker(this.#workerUrl);
|
||||
} catch (error) {
|
||||
console.error(
|
||||
"[cap] error terminating/recreating worker:",
|
||||
error,
|
||||
);
|
||||
}
|
||||
reject(new Error("Worker timeout"));
|
||||
}, 30000);
|
||||
|
||||
worker.onmessage = ({ data }) => {
|
||||
if (!data.found) return;
|
||||
clearTimeout(timeout);
|
||||
|
||||
completed++;
|
||||
this.dispatchEvent("progress", {
|
||||
progress: Math.round((completed / total) * 100),
|
||||
@@ -317,7 +304,6 @@
|
||||
};
|
||||
|
||||
worker.onerror = (err) => {
|
||||
clearTimeout(timeout);
|
||||
this.error(`Error in worker: ${err.message || err}`);
|
||||
reject(err);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user