-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HybridWebView: browser dev tools not working #24497
Comments
Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you! Open similar issues:
Closed similar issues:
|
Seems like this is related to the answer provided in #18243 After adding the following lines to my #if MACCATALYST
Microsoft.Maui.Handlers.HybridWebViewHandler.Mapper.AppendToMapping("Inspect", (handler, view) =>
{
if (OperatingSystem.IsMacCatalystVersionAtLeast(16, 4))
{
handler.PlatformView.Inspectable = true;
// For older versions .NET Mac Versions that don't include the Inspectable field.
// handler.PlatformView.SetValueForKey(Foundation.NSObject.FromObject(true), new Foundation.NSString("inspectable"));
}
});
#endif Don't know if this makes it a duplicate since one is related to WebView and my issue would still be with HybridWebView? |
#19909 I fixed this for BlazorWebView, but AFAIK, WebView, BlazorWebView, and HybridWebView are different controls with different implementations. My fix for the original one was for BlazorWebView. A similar thing would need to be done for HybridWebView. So AFAIK this wouldn't be a dupe. |
@Eilon thoughts? |
Hmm I'll have to take a look. Pretty sure I used the Safari Dev Tools the other day while debugging HybridWebView. I'll try again. |
OK I do see the Safari Dev Tools showing up, but they're empty. So it knows it's enabled, but it doesn't show any of the contents of the web view being inspected (no elements, no requests, etc.). The code for enabling this in both BlazorWebView and HybridWebView at first glance appears to be identical... so something weird is happening. |
OK, the code if in fact identical, except for one minor detail: in HybridWebView the code that sets up the dev tools sets everything up correctly, and then doesn't use all the configuration logic that it set up! 😜 |
Alright confirmed that the problem is PEBKAC! Fix will be submitted soon! |
The dev tools settings were being set on a separate webview that wasn't being used. This change applies the settings to the webview actually being used. Fixes #24497
PR here: #24679 @mallibone thanks for the report on this! It was such a silly bug! |
Cool - thanks for taking the time. Looking forward to using it in an upcoming .NET release 😃 |
The dev tools settings were being set on a separate webview that wasn't being used. This change applies the settings to the webview actually being used. Fixes #24497
Fixed by #24679 |
Description
I currently am experiencing an issue in a small Vue app when integrating it into the hybrid web view. According to this issue #22305 the dev tools should be enabled by default. I do not see the app popping up under the Develop Safari Menu. Did see the the app showing when using the latest MAUI Blazor Hybrid template.
Steps to Reproduce
Create a new MAUI App. Add a HybridWebView with a hello world Vue app (or basic HTML/JS provided in release notes of .NET 9 Preview 7). Check Develop Menu of Safari. No App appears under my current machine.
Link to public reproduction project repository
No response
Version with bug
9.0.0-preview.7.24407.4
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
macOS
Affected platform versions
macOS Sonoma 14.6.1
Did you find any workaround?
No
Relevant log output
No response
The text was updated successfully, but these errors were encountered: