|
@@ -18,7 +18,7 @@ const originWhitelistToRegex = (originWhitelist: string): string =>
|
18
|
18
|
`^${escapeStringRegexp(originWhitelist).replace(/\\\*/g, '.*')}`;
|
19
|
19
|
|
20
|
20
|
const passesWhitelist = (
|
21
|
|
- compiledWhitelist: ReadonlyArray<string>,
|
|
21
|
+ compiledWhitelist: readonly string[],
|
22
|
22
|
url: string,
|
23
|
23
|
) => {
|
24
|
24
|
const origin = extractOrigin(url);
|
|
@@ -26,8 +26,8 @@ const passesWhitelist = (
|
26
|
26
|
};
|
27
|
27
|
|
28
|
28
|
const compileWhitelist = (
|
29
|
|
- originWhitelist: ReadonlyArray<string>,
|
30
|
|
-): ReadonlyArray<string> =>
|
|
29
|
+ originWhitelist: readonly string[],
|
|
30
|
+): readonly string[] =>
|
31
|
31
|
['about:blank', ...(originWhitelist || [])].map(originWhitelistToRegex);
|
32
|
32
|
|
33
|
33
|
const createOnShouldStartLoadWithRequest = (
|
|
@@ -36,7 +36,7 @@ const createOnShouldStartLoadWithRequest = (
|
36
|
36
|
url: string,
|
37
|
37
|
lockIdentifier: number,
|
38
|
38
|
) => void,
|
39
|
|
- originWhitelist: ReadonlyArray<string>,
|
|
39
|
+ originWhitelist: readonly string[],
|
40
|
40
|
onShouldStartLoadWithRequest?: OnShouldStartLoadWithRequest,
|
41
|
41
|
) => {
|
42
|
42
|
return ({ nativeEvent }: WebViewNavigationEvent) => {
|