mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-03 18:48:06 +09:00
Brave Shields blocks our bot protection mechanism (matchMedia fingerprinting detection), causing form submissions to silently fail. - Added getBraveErrorHtml() in SDK that returns error message HTML - Form component renders the error when Brave is detected See: https://github.com/brave/brave-browser/issues/46541
23 lines
702 B
TypeScript
23 lines
702 B
TypeScript
/**
|
|
* Used to identify form inside server handler
|
|
*/
|
|
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;
|
|
};
|