a5ce1ad767
Summary: @public This diff fixes two bugs: 1. When you load a `<WebView/>` with an HTML source string, HTML source doesn't render in the `<WebView/>`. Instead, we get this warning: https://pxl.cl/grz3. Here's what the above page should look like when correctly rendered: https://pxl.cl/grzt 2. Furthermore, you render a blank `<WebView/>` (i.e: with no source prop), it should display a blank page. Instead, we get this warning: https://pxl.cl/grz3 **Bugfix:** One solution I found was to ensure that `about:blank` is always whitelisted. That way, we don't ever abort navigations to blank pages, which occur when we do: ```ObjectiveC /** Line 134 in RCTWebView.m */ [_webView loadHTMLString:@"" baseURL:nil]; ``` and ```ObjectiveC /** Line 115 in RCTWebView.m */ if (html) { NSURL *baseURL = [RCTConvert NSURL:source[@"baseUrl"]]; if (!baseURL) { baseURL = [NSURL URLWithString:@"about:blank"]; } [_webView loadHTMLString:html baseURL:baseURL]; return; } ``` Reviewed By: yungsters, mmmulani Differential Revision: D9259852 fbshipit-source-id: e1b9673fcd8c3d0df77308df8c4a632a2b596bfb |
||
---|---|---|
.. | ||
__tests__ | ||
WebView.android.js | ||
WebView.ios.js | ||
WebViewShared.js |