Skip to content

Add updated WKWebView Inspectable flag#14610

Merged
Eilon merged 3 commits into
dotnet:mainfrom
drasticactions:dev/timill/blazor-dev-tools
Apr 17, 2023
Merged

Add updated WKWebView Inspectable flag#14610
Eilon merged 3 commits into
dotnet:mainfrom
drasticactions:dev/timill/blazor-dev-tools

Conversation

@drasticactions
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@Eilon
Copy link
Copy Markdown
Contributor

Eilon commented Apr 17, 2023

Thank you @drasticactions !

@MMtwo
Copy link
Copy Markdown

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
Copy Markdown
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 fixed-in-8.0.0-preview.4.8333 Look for this fix in 8.0.0-preview.4.8333!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cannot use developer tools to debug blazor hybrid MAUI application in Mac OS Enable using Safari dev tools with BlazorWebView

6 participants