0
votes

For context : I wanted to make a simple bot-detection mechanism (captcha) on a registration page. So I decided to have an iframe with a small Blazor client-side app that just shows a checkbox and does some C# operations (hashing a variable with a salt). Since this gets compiled to wasm, it would be pretty hard to bypass. I realize it's not impossible, but for a small site it should be more than enough. It's more userfriendly than having to type something, and it doesn't have dependencies on 3rd party tools like google's recaptcha.

But obviously, this will not work on older browsers. I could show an alternative captcha for those browsers, but the Blazor docs are not very helpful when it comes to browser support (they just say "latest").

Is there a way to determine whether a browser will be able to handle Blazor correctly?

Would it be good enough to just detect if the browser supports WebAssembly? Or does Blazor have other requirements?

Thanks!

1

1 Answers

2
votes

None of your C# code is getting compiled to WebAssembly. Only the Mono runtime is compiled to WebAssembly, it then loads and runs your application DLLs directly in the browser. Just wanted to clear that up first.

To answer your question about browser compatibility. You can check which browsers support WebAssembly via the CanIUse.com web site (https://caniuse.com/#search=webassembly).

I would just add that using Blazor for this is quite a heavy solution right now, the standard file > new Blazor project is around 2.4mb, which is quite a lot just to show a checkbox.