Skip to content
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

Add updated WKWebView Inspectable flag #14610

Merged
merged 3 commits into from
Apr 17, 2023

Conversation

drasticactions
Copy link
Contributor

@drasticactions drasticactions commented Apr 17, 2023

Description of Change

Adds the "Inspectable" flag to the WKWebView implementation of BlazorWebView, this should allow the Safari Dev Tools to work again.

スクリーンショット 2023-04-17 18 29 44

スクリーンショット 2023-04-17 18 30 19

Issues Fixed

Fixes #14590
fixes #14835

@drasticactions drasticactions marked this pull request as ready for review April 17, 2023 09:30
@drasticactions drasticactions requested a review from a team as a code owner April 17, 2023 09:30
Copy link
Member

@javiercn javiercn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Eilon thoughts?

@drasticactions
Copy link
Contributor Author

Glad that those Unit Tests run on earlier versions! Guess that command wasn't available in previous versions like I thought, so it does blow up. Wrapping it in a preprocessor definition should fix it.

When this gets documented, we need to clarify that it's only supported on 16.4+ iOS builds and 13.3+ Mac Catalyst builds.

@Eilon Eilon added the area-blazor Blazor Hybrid / Desktop, BlazorWebView label Apr 17, 2023
@Eilon Eilon merged commit be08715 into dotnet:main Apr 17, 2023
29 checks passed
@Eilon
Copy link
Member

Eilon commented Apr 17, 2023

Thank you @drasticactions !

@MMtwo
Copy link

MMtwo commented May 11, 2023

@Eilon This issue still reproduces on .NET 8.0 Preview 4 (8.0.0-preview.4.23228.5), Maui version: 8.0.0-preview.4.23228.5. I want to confirm whether this issue will be fixed on 8.0 P4?

@drasticactions
Copy link
Contributor Author

The code is in the net8.0 branch, https://github.com/dotnet/maui/blob/net8.0/src/BlazorWebView/src/Maui/iOS/BlazorWebViewHandler.iOS.cs#L99-L102. I'm not sure what version that is though or what commit it's based on.

But remember, this is not a MAUI bug or issue, this is something you can set on the webview yourself to enable this to work, it just so happened that Apple changed the API resulting in the "break"

If you set the code on your MacCatlayst webview, as is linked above, that should enable it. My change (and the original code) was just automating what you could have done yourself.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView
Projects
None yet
5 participants