feat: widget@0.1.33

This commit is contained in:
tiago
2025-12-23 15:52:39 +00:00
parent aa3c30028d
commit a4696c8485
5 changed files with 9 additions and 21 deletions
+2 -2
View File
@@ -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/`);
+4 -2
View File
@@ -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)**
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -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
View File
@@ -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);
};