Skip to content

Commit e044c7c

Browse files
committed
url polyfill: Consume from global URL (again).
A continuation of 413bf95, this time converting all remaining instances. I missed the one in this file in a rebase.
1 parent 3ffddf9 commit e044c7c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/webview/MessageList.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { Platform, NativeModules } from 'react-native';
44
import { WebView } from 'react-native-webview';
55
import type { WebViewNavigation } from 'react-native-webview';
66
import { connectActionSheet } from '@expo/react-native-action-sheet';
7-
import { URL as WhatwgURL } from 'react-native-url-polyfill';
87

98
import type {
109
AlertWordsState,
@@ -133,15 +132,15 @@ export type Props = $ReadOnly<{|
133132
*/
134133
const assetsUrl =
135134
Platform.OS === 'ios'
136-
? new WhatwgURL(NativeModules.ZLPConstants.resourceURL)
137-
: new WhatwgURL('file:///android_asset/');
135+
? new URL(NativeModules.ZLPConstants.resourceURL)
136+
: new URL('file:///android_asset/');
138137

139138
/**
140139
* The URL of the webview-assets folder.
141140
*
142141
* This is the folder populated at build time by `tools/build-webview`.
143142
*/
144-
const webviewAssetsUrl = new WhatwgURL('webview/', assetsUrl);
143+
const webviewAssetsUrl = new URL('webview/', assetsUrl);
145144

146145
class MessageList extends Component<Props> {
147146
static contextType = ThemeContext;
@@ -253,7 +252,7 @@ class MessageList extends Component<Props> {
253252
* and cross-domain security restrictions have somewhere to
254253
* believe that this document originates from.
255254
*/
256-
const baseUrl = new WhatwgURL('index.html', webviewAssetsUrl);
255+
const baseUrl = new URL('index.html', webviewAssetsUrl);
257256

258257
// Paranoia^WSecurity: only load `baseUrl`, and only load it once. Any other
259258
// requests should be handed off to the OS, not loaded inside the WebView.

0 commit comments

Comments
 (0)