You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[ios] HtmlWebViewSource.BaseUrl is applied with an unexpected prefix #19792
Setting HtmlWebViewSource.BaseUrl results in different window.location.href on iOS and Android respectively.
Android ==> BaseUrl is applied as is
iOS ==> some file://...<appBundle>.../... prefix is mixed with BaseUrl value which breaks some of the page content.
ACTUAL RESULT (from debug alert() javascript logs)
Android:
iOS:
EXPECTED RESULT window.location.href is equal to HtmlWebViewSource.BaseUrl on both platforms
Steps to Reproduce
private static string BaseUrlForCaptcha => "https://identity-dev.coinpaymints.com";
// then in ctor() of ContentView
{
PlainWebviewHtmlSource.BaseUrl = BaseUrlForCaptcha;
PlainWebviewHtmlSource.Html = pageContentsHtml;
}
// then in onload() in pageContentsHtml
alert(window.location.href);
The native WKWebView of iOS sdk shows the baseUrl as expected.
So it seems like MAUI is modifying it under the hood for some reason. So please add a flag to disable that behaviour when needed.
[upd] same results for the UIWebView native control
Activity
dodikk commentedon Jan 9, 2024
Here is a minimal sample link as requested
https://github.com/dodikk/bug-maui-webview-baseurl
dodikk commentedon Jan 10, 2024
The native
WKWebViewof iOS sdk shows thebaseUrlas expected.So it seems like MAUI is modifying it under the hood for some reason. So please add a flag to disable that behaviour when needed.
[upd] same results for the
UIWebViewnative controlp.s. the native sample is in the same repository
https://github.com/dodikk/bug-maui-webview-baseurl
dodikk commentedon Jan 10, 2024
Seems like
NSBundle.MainBundle.BundlePathis concatenated with the value provided by me.However, i am unable to find that in maui codebase
https://github.com/search?q=repo%3Adotnet%2Fmaui+%22NSBundle.MainBundle.BundlePath%22&type=code
27 remaining items
[iOS/Mac] Keep an HtmlWebViewSource.BaseUrl with a scheme as a URL (#…
[iOS/Mac] Keep an HtmlWebViewSource.BaseUrl with a scheme as a URL (#…
[iOS/Mac] Keep an HtmlWebViewSource.BaseUrl with a scheme as a URL (#…
[iOS/Mac] Keep an HtmlWebViewSource.BaseUrl with a scheme as a URL (#…
[iOS/Mac] Keep an HtmlWebViewSource.BaseUrl with a scheme as a URL (#…
[iOS/Mac] Keep an HtmlWebViewSource.BaseUrl with a scheme as a URL (#…
[iOS/Mac] Keep an HtmlWebViewSource.BaseUrl with a scheme as a URL (#…
[iOS/Mac] Keep an HtmlWebViewSource.BaseUrl with a scheme as a URL (#…
[iOS/Mac] Keep an HtmlWebViewSource.BaseUrl with a scheme as a URL (#…
[iOS/Mac] Keep an HtmlWebViewSource.BaseUrl with a scheme as a URL (#…
[iOS/Mac] Keep an HtmlWebViewSource.BaseUrl with a scheme as a URL (#…
[iOS/Mac] Keep an HtmlWebViewSource.BaseUrl with a scheme as a URL (#…
[iOS/Mac] Keep an HtmlWebViewSource.BaseUrl with a scheme as a URL (d…