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

[Mac] Fix loading local resources on Webview #2436

Merged
merged 1 commit into from Mar 17, 2023
Merged

Conversation

Miepee
Copy link
Contributor

@Miepee Miepee commented Mar 4, 2023

This just used the info from #2380, I don't currently have access to a Mac, so I didn't test this.

@somelinguist can you (or someone else) use the action-built test suite from here to see whether the fix correctly works?

Fixes #2380 (hopefully)

@cwensley
Copy link
Member

cwensley commented Mar 5, 2023

Hey @Miepee, thanks for the fix! This is great, however I think you are missing a null check on baseUri before using it, which is its default value.

@cwensley cwensley added the bug label Mar 5, 2023
@cwensley cwensley added this to the 2.7.4 milestone Mar 5, 2023
@Miepee
Copy link
Contributor Author

Miepee commented Mar 5, 2023

As far as I can see, the ToNS() extension method already includes the null check.

		public static NSUrl ToNS(this Uri uri)
		{
			return uri == null ? null : new NSUrl(uri.AbsoluteUri);
		}

@cwensley
Copy link
Member

cwensley commented Mar 6, 2023

While that is true, the WKWebView.LoadFileUrl() call does not allow null for either of its parameters, so it will crash.

@cwensley cwensley merged commit 25d9dd8 into picoe:develop Mar 17, 2023
@Miepee Miepee deleted the 2380 branch May 19, 2023 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Loading local resources (JS, CSS, images) in WebView doesn't work on Mac when calling LoadHtml()
2 participants