Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
fix: Make WebHook forms work on Brave browser (#5590)
Oleg Isonen5318d4f7a6c4
diff --git a/fixtures/react-router-cloudflare/app/routes/[another-page]._index.tsx b/fixtures/react-router-cloudflare/app/routes/[another-page]._index.tsxindex 327de57786..b090c5c4f0 100644--- a/fixtures/react-router-cloudflare/app/routes/[another-page]._index.tsx+++ b/fixtures/react-router-cloudflare/app/routes/[another-page]._index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/react-router-cloudflare/app/routes/_index.tsx b/fixtures/react-router-cloudflare/app/routes/_index.tsxindex d9f3203999..2aed2df25e 100644--- a/fixtures/react-router-cloudflare/app/routes/_index.tsx+++ b/fixtures/react-router-cloudflare/app/routes/_index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/react-router-docker/app/routes/[another-page]._index.tsx b/fixtures/react-router-docker/app/routes/[another-page]._index.tsxindex 327de57786..b090c5c4f0 100644--- a/fixtures/react-router-docker/app/routes/[another-page]._index.tsx+++ b/fixtures/react-router-docker/app/routes/[another-page]._index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/react-router-docker/app/routes/_index.tsx b/fixtures/react-router-docker/app/routes/_index.tsxindex d9f3203999..2aed2df25e 100644--- a/fixtures/react-router-docker/app/routes/_index.tsx+++ b/fixtures/react-router-docker/app/routes/_index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/react-router-netlify/app/routes/[another-page]._index.tsx b/fixtures/react-router-netlify/app/routes/[another-page]._index.tsxindex 327de57786..b090c5c4f0 100644--- a/fixtures/react-router-netlify/app/routes/[another-page]._index.tsx+++ b/fixtures/react-router-netlify/app/routes/[another-page]._index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/react-router-netlify/app/routes/_index.tsx b/fixtures/react-router-netlify/app/routes/_index.tsxindex d9f3203999..2aed2df25e 100644--- a/fixtures/react-router-netlify/app/routes/_index.tsx+++ b/fixtures/react-router-netlify/app/routes/_index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/react-router-vercel/app/routes/[another-page]._index.tsx b/fixtures/react-router-vercel/app/routes/[another-page]._index.tsxindex 327de57786..b090c5c4f0 100644--- a/fixtures/react-router-vercel/app/routes/[another-page]._index.tsx+++ b/fixtures/react-router-vercel/app/routes/[another-page]._index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/react-router-vercel/app/routes/_index.tsx b/fixtures/react-router-vercel/app/routes/_index.tsxindex d9f3203999..2aed2df25e 100644--- a/fixtures/react-router-vercel/app/routes/_index.tsx+++ b/fixtures/react-router-vercel/app/routes/_index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/webstudio-cloudflare-template/app/routes/[another-page]._index.tsx b/fixtures/webstudio-cloudflare-template/app/routes/[another-page]._index.tsxindex 7e8389db11..6d1a022011 100644--- a/fixtures/webstudio-cloudflare-template/app/routes/[another-page]._index.tsx+++ b/fixtures/webstudio-cloudflare-template/app/routes/[another-page]._index.tsx@@ -245,16 +245,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx b/fixtures/webstudio-cloudflare-template/app/routes/_index.tsxindex 39826a6bb6..8c6db28bba 100644--- a/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx+++ b/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx@@ -245,16 +245,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/webstudio-features/app/routes/[_route_with_symbols_]._index.tsx b/fixtures/webstudio-features/app/routes/[_route_with_symbols_]._index.tsxindex 9c69f8ebb0..c4dbfa2841 100644--- a/fixtures/webstudio-features/app/routes/[_route_with_symbols_]._index.tsx+++ b/fixtures/webstudio-features/app/routes/[_route_with_symbols_]._index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/webstudio-features/app/routes/[animations]._index.tsx b/fixtures/webstudio-features/app/routes/[animations]._index.tsxindex 20c9f9f78e..b69e97ac2a 100644--- a/fixtures/webstudio-features/app/routes/[animations]._index.tsx+++ b/fixtures/webstudio-features/app/routes/[animations]._index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/webstudio-features/app/routes/[assets1]._index.tsx b/fixtures/webstudio-features/app/routes/[assets1]._index.tsxindex a8a34cf5c4..8e20af293b 100644--- a/fixtures/webstudio-features/app/routes/[assets1]._index.tsx+++ b/fixtures/webstudio-features/app/routes/[assets1]._index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/webstudio-features/app/routes/[class-names]._index.tsx b/fixtures/webstudio-features/app/routes/[class-names]._index.tsxindex d76dbd3d6b..3027094b47 100644--- a/fixtures/webstudio-features/app/routes/[class-names]._index.tsx+++ b/fixtures/webstudio-features/app/routes/[class-names]._index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/webstudio-features/app/routes/[content-block]._index.tsx b/fixtures/webstudio-features/app/routes/[content-block]._index.tsxindex 9ff7f64ed8..1d6413738c 100644--- a/fixtures/webstudio-features/app/routes/[content-block]._index.tsx+++ b/fixtures/webstudio-features/app/routes/[content-block]._index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/webstudio-features/app/routes/[duration]._index.tsx b/fixtures/webstudio-features/app/routes/[duration]._index.tsxindex fb58abafb9..d951ffeff1 100644--- a/fixtures/webstudio-features/app/routes/[duration]._index.tsx+++ b/fixtures/webstudio-features/app/routes/[duration]._index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/webstudio-features/app/routes/[expressions]._index.tsx b/fixtures/webstudio-features/app/routes/[expressions]._index.tsxindex f38b863326..1caffd85d4 100644--- a/fixtures/webstudio-features/app/routes/[expressions]._index.tsx+++ b/fixtures/webstudio-features/app/routes/[expressions]._index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/webstudio-features/app/routes/[form]._index.tsx b/fixtures/webstudio-features/app/routes/[form]._index.tsxindex afbba63718..58a479a6f5 100644--- a/fixtures/webstudio-features/app/routes/[form]._index.tsx+++ b/fixtures/webstudio-features/app/routes/[form]._index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/webstudio-features/app/routes/[head-tag]._index.tsx b/fixtures/webstudio-features/app/routes/[head-tag]._index.tsxindex e3f49886fc..59f17b5699 100644--- a/fixtures/webstudio-features/app/routes/[head-tag]._index.tsx+++ b/fixtures/webstudio-features/app/routes/[head-tag]._index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/webstudio-features/app/routes/[heading-with-id]._index.tsx b/fixtures/webstudio-features/app/routes/[heading-with-id]._index.tsxindex 3ad987722c..1bcdfd80bd 100644--- a/fixtures/webstudio-features/app/routes/[heading-with-id]._index.tsx+++ b/fixtures/webstudio-features/app/routes/[heading-with-id]._index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/webstudio-features/app/routes/[nested].[nested-page]._index.tsx b/fixtures/webstudio-features/app/routes/[nested].[nested-page]._index.tsxindex 1be009c970..c55e7a3776 100644--- a/fixtures/webstudio-features/app/routes/[nested].[nested-page]._index.tsx+++ b/fixtures/webstudio-features/app/routes/[nested].[nested-page]._index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/webstudio-features/app/routes/[radix]._index.tsx b/fixtures/webstudio-features/app/routes/[radix]._index.tsxindex d04a936a09..e61045515d 100644--- a/fixtures/webstudio-features/app/routes/[radix]._index.tsx+++ b/fixtures/webstudio-features/app/routes/[radix]._index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/webstudio-features/app/routes/[resources]._index.tsx b/fixtures/webstudio-features/app/routes/[resources]._index.tsxindex df0e4df1de..5c1be48481 100644--- a/fixtures/webstudio-features/app/routes/[resources]._index.tsx+++ b/fixtures/webstudio-features/app/routes/[resources]._index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/webstudio-features/app/routes/[text-duration]._index.tsx b/fixtures/webstudio-features/app/routes/[text-duration]._index.tsxindex b0d4de5472..b0474c263b 100644--- a/fixtures/webstudio-features/app/routes/[text-duration]._index.tsx+++ b/fixtures/webstudio-features/app/routes/[text-duration]._index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/fixtures/webstudio-features/app/routes/_index.tsx b/fixtures/webstudio-features/app/routes/_index.tsxindex d9f3203999..2aed2df25e 100644--- a/fixtures/webstudio-features/app/routes/_index.tsx+++ b/fixtures/webstudio-features/app/routes/_index.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/packages/cli/templates/defaults/app/route-templates/html.tsx b/packages/cli/templates/defaults/app/route-templates/html.tsxindex b183fa898b..74ff66addd 100644--- a/packages/cli/templates/defaults/app/route-templates/html.tsx+++ b/packages/cli/templates/defaults/app/route-templates/html.tsx@@ -245,16 +245,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/packages/cli/templates/react-router/app/route-templates/html.tsx b/packages/cli/templates/react-router/app/route-templates/html.tsxindex dd9f5df307..0ce5fe4f6c 100644--- a/packages/cli/templates/react-router/app/route-templates/html.tsx+++ b/packages/cli/templates/react-router/app/route-templates/html.tsx@@ -244,16 +244,21 @@ export const action = async ({throw new Error("Form bot field not found");}- const submitTime = parseInt(formBotValue, 16);- // Assumes that the difference between the server time and the form submission time,- // including any client-server time drift, is within a 5-minute range.- // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.- // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`- if (- Number.isNaN(submitTime) ||- Math.abs(Date.now() - submitTime) > 1000 * 60 * 5- ) {- throw new Error(`Form bot value invalid ${formBotValue}`);+ // Skip timestamp validation for Brave browser+ // Brave Shields blocks matchMedia fingerprinting detection used in bot protection+ // See: https://github.com/brave/brave-browser/issues/46541+ if (formBotValue !== "brave") {+ const submitTime = parseInt(formBotValue, 16);+ // Assumes that the difference between the server time and the form submission time,+ // including any client-server time drift, is within a 5-minute range.+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`+ if (+ Number.isNaN(submitTime) ||+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5+ ) {+ throw new Error(`Form bot value invalid ${formBotValue}`);+ }}formData.delete(formIdFieldName);diff --git a/packages/sdk-components-react-remix/src/webhook-form.tsx b/packages/sdk-components-react-remix/src/webhook-form.tsxindex 4a30631c8e..392348abe0 100644--- a/packages/sdk-components-react-remix/src/webhook-form.tsx+++ b/packages/sdk-components-react-remix/src/webhook-form.tsx@@ -6,7 +6,11 @@ import {useEffect,} from "react";import { useFetcher, type Fetcher, type FormProps } from "@remix-run/react";-import { formIdFieldName, formBotFieldName } from "@webstudio-is/sdk/runtime";+import {+ formIdFieldName,+ formBotFieldName,+ isBraveBrowser,+} from "@webstudio-is/sdk/runtime";export const defaultTag = "form";@@ -100,6 +104,7 @@ export const WebhookForm = forwardRef</*** Add hidden field generated using js with simple jsdom detector.* This is used to protect form submission against very simple bots.+ * Skipped for Brave browser due to: https://github.com/brave/brave-browser/issues/46541*/const handleSubmitAndAddHiddenJsField = (event: React.FormEvent<HTMLFormElement>@@ -107,8 +112,13 @@ export const WebhookForm = forwardRef<const hiddenInput = document.createElement("input");hiddenInput.type = "hidden";hiddenInput.name = formBotFieldName;- // Non-numeric values are utilized for logging purposes.- hiddenInput.value = isJSDom() ? "jsdom" : Date.now().toString(16);+ // Skip bot detection for Brave - Shields blocks matchMedia fingerprinting detection+ if (isBraveBrowser()) {+ hiddenInput.value = "brave";+ } else {+ // Non-numeric values are utilized for logging purposes.+ hiddenInput.value = isJSDom() ? "jsdom" : Date.now().toString(16);+ }event.currentTarget.appendChild(hiddenInput);};diff --git a/packages/sdk-components-react-router/src/webhook-form.tsx b/packages/sdk-components-react-router/src/webhook-form.tsxindex 21f145340b..9fa7050e04 100644--- a/packages/sdk-components-react-router/src/webhook-form.tsx+++ b/packages/sdk-components-react-router/src/webhook-form.tsx@@ -6,7 +6,11 @@ import {useEffect,} from "react";import { useFetcher, type Fetcher, type FormProps } from "react-router";-import { formIdFieldName, formBotFieldName } from "@webstudio-is/sdk/runtime";+import {+ formIdFieldName,+ formBotFieldName,+ isBraveBrowser,+} from "@webstudio-is/sdk/runtime";export const defaultTag = "form";@@ -100,6 +104,7 @@ export const WebhookForm = forwardRef</*** Add hidden field generated using js with simple jsdom detector.* This is used to protect form submission against very simple bots.+ * Skipped for Brave browser due to: https://github.com/brave/brave-browser/issues/46541*/const handleSubmitAndAddHiddenJsField = (event: React.FormEvent<HTMLFormElement>@@ -107,8 +112,13 @@ export const WebhookForm = forwardRef<const hiddenInput = document.createElement("input");hiddenInput.type = "hidden";hiddenInput.name = formBotFieldName;- // Non-numeric values are utilized for logging purposes.- hiddenInput.value = isJSDom() ? "jsdom" : Date.now().toString(16);+ // Skip bot detection for Brave - Shields blocks matchMedia fingerprinting detection+ if (isBraveBrowser()) {+ hiddenInput.value = "brave";+ } else {+ // Non-numeric values are utilized for logging purposes.+ hiddenInput.value = isJSDom() ? "jsdom" : Date.now().toString(16);+ }event.currentTarget.appendChild(hiddenInput);};diff --git a/packages/sdk/src/form-fields.ts b/packages/sdk/src/form-fields.tsindex 9d875608b2..8a331c6a51 100644--- a/packages/sdk/src/form-fields.ts+++ b/packages/sdk/src/form-fields.ts@@ -6,3 +6,17 @@ export const formIdFieldName = `ws--form-id`;* Used for simlpe protection against non js bots*/export const formBotFieldName = `ws--form-bot`;++/**+ * Detects if the browser is Brave.+ * Brave Shields blocks our bot protection mechanism (matchMedia fingerprinting detection),+ * causing form submissions to silently fail.+ * @see https://github.com/brave/brave-browser/issues/46541+ */+export const isBraveBrowser = (): boolean => {+ if (typeof navigator === "undefined") {+ return false;+ }+ // @ts-expect-error - brave is a non-standard property+ return navigator.brave?.isBrave?.() === true || navigator.brave !== undefined;+};