I'm developing a MAUI app where I use the following code snippet to open a Chrome browser within the app on Android devices:
Uri uri = new Uri(serverURL);
BrowserLaunchOptions options = new BrowserLaunchOptions()
{
LaunchMode = BrowserLaunchMode.SystemPreferred,
TitleMode = BrowserTitleMode.Hide,
PreferredToolbarColor = Colors.Violet,
PreferredControlColor = Colors.SandyBrown,
};
await Browser.Default.OpenAsync(uri, options);
This code successfully opens the Chrome browser inside the app on Android devices. However, when testing the same app on a Chromebook, it opens the Chrome browser outside the application in a new tab instead of within the app itself.
I've ensured that the code runs without errors, and I'm using MAUI for cross-platform development. Is there any specific configuration or additional code required to ensure that the Chrome browser opens within the MAUI app on Chromebook as it does on Android devices?
Any guidance, suggestions, or insights on how to make this work consistently across both platforms would be greatly appreciated. Thank you!
I expected the same behavior on Chromebook as on Android devices, where the Chrome browser would open within the .NET MAUI application rather than launching in a separate tab. I assumed that the code I used for Android would function consistently across platforms, but it appears there might be an issue or discrepancy specific to Chromebook that needs addressing.