From the .NET 9, the .NET MAUI Blazor Hybrid and Web App"-type project is available.
It has the shared code for both Web and native platform.
But how to check programmatically is application been run via Browser as web app, or is being executed as native application? It should be something like:
// WARINING: It is NOT the actual API
if (Runtime.IsWeb()) {
System.Diagnostics.Debug.WriteLine("Running via web. The files management is not available");
}
if (Runtime.IsNative()) {
System.Diagnostics.Debug.WriteLine("Running as native app. The files management is available");
}