react-native-minimal-webview 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -18
- package/android/build.gradle +1 -1
- package/android/consumer-rules.pro +1 -1
- package/android/src/main/java/expo/modules/minimalwebview/DocumentEnd.kt +3 -3
- package/android/src/main/java/expo/modules/minimalwebview/Hooks.kt +33 -42
- package/android/src/main/java/expo/modules/minimalwebview/MinimalWebView.kt +7 -10
- package/android/src/main/java/expo/modules/minimalwebview/MinimalWebViewClients.kt +5 -6
- package/android/src/main/java/expo/modules/minimalwebview/MinimalWebViewModule.kt +4 -4
- package/android/src/main/java/expo/modules/minimalwebview/MinimalWebViewScripts.kt +14 -8
- package/android/src/main/java/expo/modules/minimalwebview/PlatformSettings.kt +13 -16
- package/android/src/main/java/expo/modules/minimalwebview/PullToRefresh.kt +1 -1
- package/android/src/main/java/expo/modules/minimalwebview/requests/Downloads.kt +6 -5
- package/android/src/main/java/expo/modules/minimalwebview/requests/FileUpload.kt +1 -1
- package/android/src/main/java/expo/modules/minimalwebview/requests/FullscreenVideo.kt +1 -1
- package/android/src/main/java/expo/modules/minimalwebview/requests/Permissions.kt +3 -3
- package/build/WebView.d.ts +6 -9
- package/build/WebView.d.ts.map +1 -1
- package/build/WebView.js +23 -18
- package/build/WebView.js.map +1 -1
- package/build/bridge/createBridge.d.ts +3 -3
- package/build/bridge/createBridge.d.ts.map +1 -1
- package/build/bridge/createBridge.js +5 -3
- package/build/bridge/createBridge.js.map +1 -1
- package/build/bridge/endpoint.d.ts +0 -2
- package/build/bridge/endpoint.d.ts.map +1 -1
- package/build/bridge/endpoint.js +8 -3
- package/build/bridge/endpoint.js.map +1 -1
- package/build/bridge/origins.d.ts.map +1 -1
- package/build/bridge/origins.js +0 -1
- package/build/bridge/origins.js.map +1 -1
- package/build/bridge/pageClient.generated.d.ts +1 -1
- package/build/bridge/pageClient.generated.d.ts.map +1 -1
- package/build/bridge/pageClient.generated.js +1 -1
- package/build/bridge/pageClient.generated.js.map +1 -1
- package/build/defaultNavigationRules.d.ts +4 -5
- package/build/defaultNavigationRules.d.ts.map +1 -1
- package/build/defaultNavigationRules.js +4 -5
- package/build/defaultNavigationRules.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js +1 -1
- package/build/platform.generated.d.ts +14 -15
- package/build/platform.generated.d.ts.map +1 -1
- package/build/platform.generated.js +5 -3
- package/build/platform.generated.js.map +1 -1
- package/build/reactNativeWebViewDefaults.d.ts +2 -2
- package/build/reactNativeWebViewDefaults.js +2 -2
- package/build/reactNativeWebViewMessages.d.ts +8 -14
- package/build/reactNativeWebViewMessages.d.ts.map +1 -1
- package/build/reactNativeWebViewMessages.js +8 -14
- package/build/reactNativeWebViewMessages.js.map +1 -1
- package/build/refStore.d.ts +11 -10
- package/build/refStore.d.ts.map +1 -1
- package/build/refStore.js +7 -5
- package/build/refStore.js.map +1 -1
- package/build/types.d.ts +328 -282
- package/build/types.d.ts.map +1 -1
- package/ios/DelegateProxy.swift +2 -6
- package/ios/DocumentEnd.swift +7 -8
- package/ios/DownloadName.swift +1 -3
- package/ios/Hooks.swift +23 -21
- package/ios/MRWExceptions.h +1 -1
- package/ios/MRWInvoke.h +25 -10
- package/ios/MinimalWebView+Dialogs.swift +4 -7
- package/ios/MinimalWebView+Navigation.swift +25 -26
- package/ios/MinimalWebView+Scripts.swift +3 -3
- package/ios/MinimalWebView.swift +12 -11
- package/ios/NavigationRules.swift +1 -1
- package/ios/OriginRules.swift +3 -2
- package/ios/PlatformSettings.swift +14 -9
- package/ios/Recovery.swift +3 -3
- package/package.json +9 -4
- package/src/WebView.tsx +22 -19
- package/src/bridge/createBridge.ts +5 -3
- package/src/bridge/endpoint.ts +7 -3
- package/src/bridge/origins.ts +0 -1
- package/src/bridge/pageClient.generated.ts +1 -1
- package/src/bridge/pageClient.ts +1 -2
- package/src/defaultNavigationRules.ts +4 -5
- package/src/index.ts +1 -1
- package/src/platform.generated.ts +14 -15
- package/src/reactNativeWebViewDefaults.ts +2 -2
- package/src/reactNativeWebViewMessages.ts +8 -14
- package/src/refStore.ts +12 -11
- package/src/types.ts +328 -282
package/build/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,KAAK,EACV,kBAAkB,EAClB,OAAO,EACP,MAAM,EACN,MAAM,EACN,cAAc,EACd,YAAY,EACb,MAAM,sBAAsB,CAAC;AAE9B;;;GAGG;AACH,MAAM,MAAM,aAAa,GACrB;IACE;;;;;OAKG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GACD;IACE,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,+GAA+G;IAC/G,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEN;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,CAAC;AAE9D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CA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,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACzD;;;;;;;;OAQG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACxE,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,gEAAgE;IAChE,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IACpC,kEAAkE;IAClE,QAAQ,IAAI,eAAe,CAAC;IAC5B;;;;OAIG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;CAC7C,CAAC"}
|
package/ios/DelegateProxy.swift
CHANGED
|
@@ -54,8 +54,6 @@ final class DelegateProxy: NSObject, WKNavigationDelegate, WKUIDelegate {
|
|
|
54
54
|
uiDelegates.forEach { $0.webViewDidClose?(webView) }
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
/// An authentication challenge, offered to each navigation delegate that implements it, in order, until one answers
|
|
58
|
-
/// other than `.performDefaultHandling`; WebKit's default handling when none does.
|
|
59
57
|
func webView(
|
|
60
58
|
_ webView: WKWebView,
|
|
61
59
|
didReceive challenge: URLAuthenticationChallenge,
|
|
@@ -103,8 +101,7 @@ final class DelegateProxy: NSObject, WKNavigationDelegate, WKUIDelegate {
|
|
|
103
101
|
private static let actionPolicyWithPreferences =
|
|
104
102
|
NSSelectorFromString("webView:decidePolicyForNavigationAction:preferences:decisionHandler:")
|
|
105
103
|
|
|
106
|
-
/// The hook delegates that implement a decision, in order: the first one takes it.
|
|
107
|
-
/// counts as the action policy.
|
|
104
|
+
/// The hook delegates that implement a decision, in order: the first one takes it.
|
|
108
105
|
private func takers(of decision: Selector) -> [NSObject] {
|
|
109
106
|
delegates(for: decision).filter {
|
|
110
107
|
$0.responds(to: decision) || decision == Self.actionPolicy && $0.responds(to: Self.actionPolicyWithPreferences)
|
|
@@ -147,8 +144,7 @@ final class DelegateProxy: NSObject, WKNavigationDelegate, WKUIDelegate {
|
|
|
147
144
|
]
|
|
148
145
|
}
|
|
149
146
|
|
|
150
|
-
///
|
|
151
|
-
/// turn on together attach in registration order, which orders their delegates.
|
|
147
|
+
/// Hooks whose keys turn on together attach in registration order, which orders their delegates.
|
|
152
148
|
func inRegistrationOrder(_ keys: Set<String>, _ registered: [String]) -> [String] {
|
|
153
149
|
registered.filter(keys.contains) + keys.subtracting(registered).sorted()
|
|
154
150
|
}
|
package/ios/DocumentEnd.swift
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
/// Why a Document ended, as ``WebViewContext/onDocumentEnd(_:)`` and ``WebViewContext/onDestroyed(_:)`` report it.
|
|
2
2
|
///
|
|
3
|
-
/// A Document is the main-frame page on screen: from a navigation's commit, a
|
|
4
|
-
///
|
|
3
|
+
/// A Document is the main-frame page on screen: from a navigation's commit to the next commit, a renderer crash or the
|
|
4
|
+
/// view closing.
|
|
5
5
|
///
|
|
6
6
|
/// The first commit after the view is made, or after a crash, opens one and ends nothing.
|
|
7
7
|
///
|
|
8
|
-
/// A Document doesn't end at a same-document navigation (`pushState`, `replaceState`, a hash change),
|
|
8
|
+
/// A Document doesn't end at a same-document navigation (`pushState`, `replaceState`, a hash change), an iframe's
|
|
9
9
|
/// navigation, a load that never commits (a stop, a download, a 204, a failure), the view leaving the window or the app
|
|
10
10
|
/// going to the background.
|
|
11
11
|
public enum DocumentEnd {
|
|
12
12
|
/// A main-frame navigation committed while a Document was open: a load, a form submit, back or forward, a reload,
|
|
13
13
|
/// an html source, a `window.open` loaded in place or a back-forward-cache restore.
|
|
14
14
|
case committed
|
|
15
|
-
/// The web content process died.
|
|
15
|
+
/// The renderer (WebKit's web content process) died.
|
|
16
16
|
///
|
|
17
|
-
/// The WKWebView stays and reloads, unless
|
|
18
|
-
///
|
|
19
|
-
/// Document.
|
|
17
|
+
/// The WKWebView stays and reloads, unless `ProcessGoneEvent.recovered` in JS is false (a POST `source` on screen,
|
|
18
|
+
/// or crash recovery's limit). Nothing attaches again: the hooks' contexts, handlers and delegates stay.
|
|
20
19
|
case crashed
|
|
21
|
-
/// The view is
|
|
20
|
+
/// The view is closing; the hooks' ``WebViewContext/onDestroyed(_:)`` handlers run after it.
|
|
22
21
|
case closing
|
|
23
22
|
}
|
package/ios/DownloadName.swift
CHANGED
|
@@ -2,9 +2,7 @@ import Foundation
|
|
|
2
2
|
|
|
3
3
|
/// The name a download is saved under, in a directory of its own.
|
|
4
4
|
enum DownloadName {
|
|
5
|
-
///
|
|
6
|
-
/// then `Downloads.safeName`): each `/` becomes `_`, and a name that is a directory (`.`, `..`) or empty becomes
|
|
7
|
-
/// `download`.
|
|
5
|
+
/// `suggested` with each `/` replaced by `_`; a result that is empty, `.` or `..` becomes `download`, as on Android (`URLUtilCompat.guessFileName`, then `Downloads.safeName`).
|
|
8
6
|
static func safe(_ suggested: String) -> String {
|
|
9
7
|
let name = suggested.replacingOccurrences(of: "/", with: "_")
|
|
10
8
|
return name.isEmpty || name == "." || name == ".." ? "download" : name
|
package/ios/Hooks.swift
CHANGED
|
@@ -3,15 +3,15 @@ import WebKit
|
|
|
3
3
|
/// Native hooks: Swift in your own Expo module that gets the real WKWebView behind each WebView, its creation-time
|
|
4
4
|
/// configuration and a ``WebViewContext``, with no protocol to implement.
|
|
5
5
|
///
|
|
6
|
-
/// The [native hooks guide](https://rasmuskard.github.io/react-native-minimal-webview/guides/native-hooks/)
|
|
7
|
-
/// walks through one.
|
|
8
|
-
///
|
|
9
6
|
/// A hook attaches to each WebView whose `extensions` prop has an extension with its key that is on;
|
|
10
7
|
/// [`HookExtension.options`](https://rasmuskard.github.io/react-native-minimal-webview/typescript/react-native-minimal-webview/type-aliases/HookExtension/#options)
|
|
11
8
|
/// says when.
|
|
12
9
|
///
|
|
13
10
|
/// - Important: Leave alone what the core owns: the WKWebView's own `navigationDelegate` and `uiDelegate` (add to the
|
|
14
11
|
/// context's lists instead), and the bridge's script message handler and user scripts.
|
|
12
|
+
///
|
|
13
|
+
/// ## See Also
|
|
14
|
+
/// - [Native hooks guide](https://rasmuskard.github.io/react-native-minimal-webview/guides/native-hooks/)
|
|
15
15
|
public enum MinimalWebViewHooks {
|
|
16
16
|
struct Hook {
|
|
17
17
|
let key: String
|
|
@@ -53,7 +53,7 @@ public enum MinimalWebViewHooks {
|
|
|
53
53
|
/// user scripts run in it and your script message handlers get its messages, so compare `message.webView` with
|
|
54
54
|
/// the WKWebView `attach` gets.
|
|
55
55
|
/// - attach: Runs once the WKWebView exists and its settings are applied, so what it sets wins over them. Register
|
|
56
|
-
/// what to run when the view goes away with ``WebViewContext/onDestroyed(_:)``. A
|
|
56
|
+
/// what to run when the view goes away with ``WebViewContext/onDestroyed(_:)``. A renderer crash
|
|
57
57
|
/// reloads the same WKWebView, so nothing attaches again (see ``DocumentEnd/crashed``).
|
|
58
58
|
/// - file: With `line`, the call site that tells a reload from a second hook; leave both to their defaults.
|
|
59
59
|
/// - line: The call site's line, with `file`.
|
|
@@ -90,8 +90,12 @@ public enum MinimalWebViewHooks {
|
|
|
90
90
|
/// says what off means. ``onOptions(_:)`` runs when the hook turns off, so it can undo what it set up, and again when
|
|
91
91
|
/// it turns on.
|
|
92
92
|
///
|
|
93
|
-
/// Values from JS arrive as Foundation's JSON types: a number as `NSNumber`, an object as `NSDictionary`,
|
|
94
|
-
///
|
|
93
|
+
/// Values from JS arrive as Foundation's JSON types: a number as `NSNumber`, an object as `NSDictionary`, an array as
|
|
94
|
+
/// `NSArray`. In an ask's answer and a ``handle(_:_:)`` handler's arguments, null is nil at the top level and `NSNull`
|
|
95
|
+
/// inside an array or object.
|
|
96
|
+
///
|
|
97
|
+
/// ## See Also
|
|
98
|
+
/// - [Native hooks guide](https://rasmuskard.github.io/react-native-minimal-webview/guides/native-hooks/)
|
|
95
99
|
public protocol WebViewContext: AnyObject {
|
|
96
100
|
/// This hook's extension's `options`, the new ones after a change; nil while the hook is off.
|
|
97
101
|
var options: Any? { get }
|
|
@@ -102,7 +106,7 @@ public protocol WebViewContext: AnyObject {
|
|
|
102
106
|
/// Your navigation delegates, in order. While the hook is off, none of them gets a callback.
|
|
103
107
|
///
|
|
104
108
|
/// WebKit reads which callbacks a delegate implements when it is assigned, so a delegate must implement what it
|
|
105
|
-
/// handles by the time you add it.
|
|
109
|
+
/// handles by the time you add it.
|
|
106
110
|
///
|
|
107
111
|
/// Each callback reaches the delegates by one of these rules:
|
|
108
112
|
/// - A decision, the action or the response policy, goes to the first delegate that implements it, instead of the
|
|
@@ -111,14 +115,16 @@ public protocol WebViewContext: AnyObject {
|
|
|
111
115
|
/// - The authentication challenge goes to each delegate that implements it, in order, until one answers other than
|
|
112
116
|
/// `.performDefaultHandling`; when none does, WebKit's default handling. Each must call its completion handler
|
|
113
117
|
/// exactly once, and the next delegate gets the challenge only after that.
|
|
114
|
-
/// - Every other callback the core implements reaches the core, then each delegate that implements it.
|
|
115
|
-
///
|
|
118
|
+
/// - Every other callback the core implements reaches the core, then each delegate that implements it.
|
|
119
|
+
/// - `didStartProvisionalNavigation` and `didReceiveServerRedirectForProvisionalNavigation` reach each delegate that
|
|
120
|
+
/// implements them.
|
|
116
121
|
/// - Any other callback goes only to the first delegate that implements it.
|
|
117
122
|
///
|
|
118
123
|
/// Taking a decision switches off what the core decides from the app's props or their defaults, the default
|
|
119
124
|
/// navigation rules' security checks included, and a warning names the callback and what stops applying. A
|
|
120
125
|
/// delegate that takes the action policy decides navigations instead of the navigation rules, which still decide new
|
|
121
|
-
/// windows unless a UI delegate takes `createWebViewWith`.
|
|
126
|
+
/// windows unless a UI delegate takes `createWebViewWith`. A new window the rules allow loads in place, and that load
|
|
127
|
+
/// reaches the delegate that takes the action policy.
|
|
122
128
|
///
|
|
123
129
|
/// A decision more than one delegate implements still goes only to the first, and a warning names it. Each
|
|
124
130
|
/// warning comes once per WebView, when the delegate is added.
|
|
@@ -154,8 +160,7 @@ public protocol WebViewContext: AnyObject {
|
|
|
154
160
|
/// Runs `handler` at once with this hook's extension's `options`, then with the new ones each time they change,
|
|
155
161
|
/// live; nil while the hook is off.
|
|
156
162
|
///
|
|
157
|
-
///
|
|
158
|
-
/// value to another doesn't run it, and a context kept after the view closed never does.
|
|
163
|
+
/// A change from one off value to another doesn't run it, and a context kept after the view closed never does.
|
|
159
164
|
func onOptions(_ handler: @escaping (_ options: Any?) -> Void)
|
|
160
165
|
/// Runs `handler` at each end of the Document (see ``DocumentEnd``), after the core's own resets: per-page
|
|
161
166
|
/// state belongs here.
|
|
@@ -163,7 +168,8 @@ public protocol WebViewContext: AnyObject {
|
|
|
163
168
|
/// Runs `handler` once this view closes, with ``DocumentEnd/closing``, the only reason it gets on iOS.
|
|
164
169
|
///
|
|
165
170
|
/// It comes after the ``onDocumentEnd(_:)`` handlers that get `closing`. The WKWebView has stopped loading, paused
|
|
166
|
-
/// its media and left the view by then, but is still alive, and the
|
|
171
|
+
/// its media, lost every script message handler (yours too) and left the view by then, but is still alive, and the
|
|
172
|
+
/// context does nothing.
|
|
167
173
|
///
|
|
168
174
|
/// Clean up here: what `attach` set up on the WKWebView, such as an observation or a swapped class.
|
|
169
175
|
func onDestroyed(_ handler: @escaping (DocumentEnd) -> Void)
|
|
@@ -190,8 +196,9 @@ public final class HookReply {
|
|
|
190
196
|
self.reject = reject
|
|
191
197
|
}
|
|
192
198
|
|
|
193
|
-
/// Resolves the JS call with `value`,
|
|
194
|
-
/// `
|
|
199
|
+
/// Resolves the JS call with `value`, converted as `ref.call`'s results are: JSON types, and also an `NSURL`, `NSDate`,
|
|
200
|
+
/// `NSData`, `UIImage`, `NSHTTPCookie`, `NSSet` or geometry struct; any other object arrives as null, and a non-finite
|
|
201
|
+
/// number rejects the call with `native_error` instead.
|
|
195
202
|
public func callAsFunction(_ value: Any?) {
|
|
196
203
|
if first() { resolve(value) }
|
|
197
204
|
}
|
|
@@ -210,13 +217,10 @@ public final class HookReply {
|
|
|
210
217
|
}
|
|
211
218
|
}
|
|
212
219
|
|
|
213
|
-
/// A hook's view of the WebView: the core's context with the hook's key on its events. The view owns it
|
|
214
|
-
/// outlive the view (an async callback): then the context is detached and does nothing.
|
|
215
|
-
/// The view routes the delegates of the contexts that are on.
|
|
220
|
+
/// A hook's view of the WebView: the core's context with the hook's key on its events. The view owns it and routes the delegates of the contexts that are on.
|
|
216
221
|
final class HookContext: WebViewContext {
|
|
217
222
|
let hook: MinimalWebViewHooks.Hook
|
|
218
223
|
private weak var view: MinimalWebView?
|
|
219
|
-
/// The `hookOptions` value while the hook is on, nil while it is off.
|
|
220
224
|
private(set) var options: Any?
|
|
221
225
|
private var optionsHandlers: [(Any?) -> Void] = []
|
|
222
226
|
private var documentEndHandlers: [(DocumentEnd) -> Void] = []
|
|
@@ -229,7 +233,6 @@ final class HookContext: WebViewContext {
|
|
|
229
233
|
options = view.hookOptions[hook.key]
|
|
230
234
|
}
|
|
231
235
|
|
|
232
|
-
/// The view closed: the context keeps nothing of it and nothing the hook gave it, and nothing routes it.
|
|
233
236
|
func detach() {
|
|
234
237
|
view = nil
|
|
235
238
|
navigationDelegates = []
|
|
@@ -294,7 +297,6 @@ final class HookContext: WebViewContext {
|
|
|
294
297
|
documentEndHandlers.forEach { $0(reason) }
|
|
295
298
|
}
|
|
296
299
|
|
|
297
|
-
/// The view closed, and its WKWebView is torn down: the handlers run once, and the context drops them.
|
|
298
300
|
func destroyed() {
|
|
299
301
|
let handlers = destroyedHandlers
|
|
300
302
|
destroyedHandlers = []
|
package/ios/MRWExceptions.h
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
NS_ASSUME_NONNULL_BEGIN
|
|
4
4
|
|
|
5
|
-
/// Runs `block` and returns the
|
|
5
|
+
/// Runs `block` and returns the Objective-C exception it raised as `name: reason`, or nil. Swift can't catch those;
|
|
6
6
|
/// Key-Value Coding raises one for an unknown key or a value a setter rejects.
|
|
7
7
|
FOUNDATION_EXPORT NSString *_Nullable MRWCatchException(void (NS_NOESCAPE ^block)(void)) NS_REFINED_FOR_SWIFT;
|
|
8
8
|
|
package/ios/MRWInvoke.h
CHANGED
|
@@ -2,16 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
NS_ASSUME_NONNULL_BEGIN
|
|
4
4
|
|
|
5
|
-
/// Calls `selector` on `target` with the JSON `args`
|
|
6
|
-
///
|
|
7
|
-
///
|
|
8
|
-
///
|
|
9
|
-
///
|
|
10
|
-
///
|
|
11
|
-
///
|
|
12
|
-
///
|
|
13
|
-
///
|
|
14
|
-
///
|
|
5
|
+
/// Calls `selector` on `target` with the JSON `args` and resolves with the result as `MRWJsonable` makes it, or with
|
|
6
|
+
/// why it couldn't.
|
|
7
|
+
///
|
|
8
|
+
/// `args` are set by the method signature's type encodings:
|
|
9
|
+
/// - booleans, numbers and strings as themselves, and nil from null;
|
|
10
|
+
/// - the four structs (UIEdgeInsets, CGPoint, CGSize, CGRect) from objects;
|
|
11
|
+
/// - `{ set: [] }`, `{ date: seconds }`, `{ data: base64 }` and `{ cookie: properties }` for an NSSet, NSDate, NSData
|
|
12
|
+
/// or NSHTTPCookie;
|
|
13
|
+
/// - any other object as is.
|
|
14
|
+
///
|
|
15
|
+
/// A selector whose last argument is a block gets the shape `completion` names, and the block resolves, with the
|
|
16
|
+
/// error's description as the error:
|
|
17
|
+
/// - `void`: `(void)`
|
|
18
|
+
/// - `value`: `(id)`
|
|
19
|
+
/// - `valueError`: `(id, NSError *)`
|
|
20
|
+
/// - `error`: `(NSError *)`
|
|
21
|
+
/// - `number`: `(NSInteger)`
|
|
22
|
+
///
|
|
23
|
+
/// Rejects, never raises, for:
|
|
24
|
+
/// - an unknown selector, a block selector without a `completion`, or a wrong argument count;
|
|
25
|
+
/// - an argument that doesn't fit, such as a tagged object that can't be made (invalid base64, a cookie without a name,
|
|
26
|
+
/// value, path, and domain or origin URL);
|
|
27
|
+
/// - an exception the method, or making its result JSON, raises.
|
|
28
|
+
///
|
|
29
|
+
/// A wrong block shape or an object argument of the wrong class is undefined behavior.
|
|
15
30
|
FOUNDATION_EXPORT void MRWInvoke(id target, SEL selector, NSArray *args, NSString *_Nullable completion,
|
|
16
31
|
void (^resolve)(id _Nullable result, NSString *_Nullable error)) NS_REFINED_FOR_SWIFT;
|
|
17
32
|
|
|
@@ -41,9 +41,8 @@ extension MinimalWebView: WKUIDelegate {
|
|
|
41
41
|
showDialog(alert) { completionHandler(nil) }
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
///
|
|
45
|
-
///
|
|
46
|
-
/// prompt.
|
|
44
|
+
/// WebKit asks the OS itself, with the app's Info.plist strings; a grant from `onPermissionRequest` skips only
|
|
45
|
+
/// WebKit's own prompt.
|
|
47
46
|
func webView(
|
|
48
47
|
_ webView: WKWebView,
|
|
49
48
|
requestMediaCapturePermissionFor origin: WKSecurityOrigin,
|
|
@@ -64,8 +63,7 @@ extension MinimalWebView: WKUIDelegate {
|
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
65
|
|
|
67
|
-
/// The frame's host
|
|
68
|
-
/// "JavaScript", as Android titles a `data:` page's dialogs, so it doesn't look like the app's own alert.
|
|
66
|
+
/// The frame's host, or "JavaScript" when it has none (an opaque origin or `file:`), as Android titles a `data:` page's dialogs: a dialog must not look like the app's own alert.
|
|
69
67
|
private func dialogTitle(_ frame: WKFrameInfo) -> String {
|
|
70
68
|
let host = frame.securityOrigin.host
|
|
71
69
|
return host.isEmpty ? "JavaScript" : host
|
|
@@ -85,8 +83,7 @@ extension MinimalWebView: WKUIDelegate {
|
|
|
85
83
|
}
|
|
86
84
|
}
|
|
87
85
|
|
|
88
|
-
///
|
|
89
|
-
/// can't present: UIKit only logs it and the page would stay blocked, so the dialog is cancelled instead.
|
|
86
|
+
/// Presents from the top of this view's window. If the top controller still has a presented one (one being dismissed) or is itself being presented, UIKit only logs and the page would stay blocked, so the dialog is cancelled instead.
|
|
90
87
|
private func showDialog(_ alert: UIAlertController, cancel: @escaping () -> Void) {
|
|
91
88
|
var top = window?.rootViewController
|
|
92
89
|
while let next = top?.presentedViewController, !next.isBeingDismissed { top = next }
|
|
@@ -20,8 +20,8 @@ extension MinimalWebView {
|
|
|
20
20
|
let request = NavigationRules.Request(
|
|
21
21
|
url: target.absoluteString, mainFrame: mainFrame, newWindow: false, userInitiated: userInitiated(action)
|
|
22
22
|
)
|
|
23
|
-
// A navigation WebKit marks as a download (`<a download>`, blob:). One no
|
|
24
|
-
// .allow would show it as a page.
|
|
23
|
+
// A navigation WebKit marks as a download (`<a download>`, blob:). One no onDownload takes is cancelled, and an
|
|
24
|
+
// http(s) one opens outside the WebView (openDownload): .allow would show it as a page.
|
|
25
25
|
let download = action.shouldPerformDownload && requestHandlers.contains("onDownload")
|
|
26
26
|
let dropped = action.shouldPerformDownload && !download
|
|
27
27
|
run(request) { [weak self] allowed in
|
|
@@ -34,11 +34,11 @@ extension MinimalWebView {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
/// Whether a user gesture started `action`: a link activation right after a tap on this view (`Taps`). WebKit
|
|
38
|
-
/// every navigation with a triggering event as `.linkActivated` (NavigationAction.cpp's navigationType),
|
|
39
|
-
/// script clicks (`element.click()`)
|
|
40
|
-
/// and Switch Control activate a link with no touch
|
|
41
|
-
/// hardware keyboard's doesn't
|
|
37
|
+
/// Whether a user gesture started `action`: a link activation right after a tap on this view (`Taps`). WebKit
|
|
38
|
+
/// reports every navigation with a triggering event as `.linkActivated` (NavigationAction.cpp's navigationType),
|
|
39
|
+
/// including a link a script clicks (`element.click()`), and no public WKNavigationAction property tells a real one
|
|
40
|
+
/// apart. VoiceOver and Switch Control activate a link with no touch, so while either runs, a link activation counts
|
|
41
|
+
/// on its own. A hardware keyboard's activation doesn't.
|
|
42
42
|
private func userInitiated(_ action: WKNavigationAction) -> Bool {
|
|
43
43
|
action.navigationType == .linkActivated
|
|
44
44
|
&& (taps.recent || UIAccessibility.isVoiceOverRunning || UIAccessibility.isSwitchControlRunning)
|
|
@@ -83,9 +83,8 @@ extension MinimalWebView {
|
|
|
83
83
|
|
|
84
84
|
/// Applies the rules (and `ask`) to a request and reports the outcome; `completion` gets whether to load it here.
|
|
85
85
|
private func run(_ request: NavigationRules.Request, completion: @escaping (Bool) -> Void) {
|
|
86
|
-
// A URL an `ask` allowed is not asked again until the next main-frame commit (redirect loops).
|
|
87
|
-
//
|
|
88
|
-
// WebKit has no redirect flag, so a tap on that URL isn't asked again either; Android skips only redirects.
|
|
86
|
+
// A URL an `ask` allowed is not asked again until the next main-frame commit (redirect loops). WebKit has no
|
|
87
|
+
// redirect flag, so a tap on that URL isn't asked again either; Android skips only redirects.
|
|
89
88
|
let decision = NavigationRules.decide(
|
|
90
89
|
navigationRules, request, asked: askedAndAllowed[request.mainFrame] ?? [],
|
|
91
90
|
canAsk: requestHandlers.contains("onNavigationRequest")
|
|
@@ -131,10 +130,10 @@ extension MinimalWebView {
|
|
|
131
130
|
|
|
132
131
|
private let askTimeout: TimeInterval = 1
|
|
133
132
|
|
|
134
|
-
/// The window `window.open('')`
|
|
135
|
-
/// popup payment buttons do. WebKit needs a WKWebView for it, made from the configuration it passes
|
|
136
|
-
///
|
|
137
|
-
///
|
|
133
|
+
/// The throwaway window for `window.open('')` or about:blank, which the page navigates later (`w.location = url`), as
|
|
134
|
+
/// async popup payment buttons do. WebKit needs a WKWebView for it, made from the configuration it passes. It is
|
|
135
|
+
/// never shown: it cancels its first navigation, hands the request on and goes. One that hasn't navigated within 5 s,
|
|
136
|
+
/// or that the page closes, goes unused.
|
|
138
137
|
private final class WindowCatcher: NSObject, WKNavigationDelegate, WKUIDelegate {
|
|
139
138
|
private var child: WKWebView?
|
|
140
139
|
private var caught: ((URLRequest) -> Void)?
|
|
@@ -176,18 +175,17 @@ private final class WindowCatcher: NSObject, WKNavigationDelegate, WKUIDelegate
|
|
|
176
175
|
|
|
177
176
|
private let newWindowTimeout: TimeInterval = 5
|
|
178
177
|
|
|
179
|
-
/// WebKit's private `_WKNavigationActionPolicyAllowWithoutTryingAppLink` (
|
|
180
|
-
/// would hand a tapped link to another host to an installed app that claims it as a universal link, which
|
|
181
|
-
/// WebView never does
|
|
182
|
-
///
|
|
183
|
-
/// satisfies the type, and nothing falls back if WebKit drops the value; only an app that claims a domain could tell.
|
|
178
|
+
/// WebKit's private `_WKNavigationActionPolicyAllowWithoutTryingAppLink` (allow + 2), as Firefox for iOS uses it:
|
|
179
|
+
/// `.allow` would hand a tapped link to another host to an installed app that claims it as a universal link, which
|
|
180
|
+
/// Android's WebView never does. Hand-off is an explicit `external` rule. `init(rawValue:)` accepts any value, so
|
|
181
|
+
/// `?? .allow` only satisfies the type: nothing falls back if WebKit drops the value.
|
|
184
182
|
private let allowInPlace = WKNavigationActionPolicy(rawValue: WKNavigationActionPolicy.allow.rawValue + 2) ?? .allow
|
|
185
183
|
|
|
186
|
-
/// When a tap on the WKWebView last ended, for `userInitiated`. It only watches the view's touches
|
|
184
|
+
/// When a tap on the WKWebView last ended, for `userInitiated`. It only watches the view's touches and never
|
|
187
185
|
/// recognizes, so it cancels, delays and prevents nothing (scrolling, links, text selection and the pull-to-refresh
|
|
188
|
-
/// control work as without it)
|
|
186
|
+
/// control work as without it). It fails at each touch's end, or as soon as the touch scrolls.
|
|
189
187
|
final class Taps: UIGestureRecognizer, UIGestureRecognizerDelegate {
|
|
190
|
-
///
|
|
188
|
+
/// System uptime, so a change of the device time doesn't affect it.
|
|
191
189
|
private var lastTap: TimeInterval = -.infinity
|
|
192
190
|
|
|
193
191
|
override init(target: Any?, action: Selector?) {
|
|
@@ -237,8 +235,9 @@ final class Taps: UIGestureRecognizer, UIGestureRecognizerDelegate {
|
|
|
237
235
|
}
|
|
238
236
|
}
|
|
239
237
|
|
|
240
|
-
///
|
|
241
|
-
/// after its double-tap wait (about 350 ms) on
|
|
242
|
-
///
|
|
243
|
-
/// script little time to ride on an unrelated tap
|
|
238
|
+
/// How long after a tap ends a link activation still counts as user-initiated. WebKit sends the click once the finger
|
|
239
|
+
/// lifts: at once on a page sized to the device (`width=device-width`), after its double-tap wait (about 350 ms) on
|
|
240
|
+
/// one that can zoom. The link's decision then follows from the web content process. The window covers a busy page
|
|
241
|
+
/// and a redirect of the tapped link. It stays short so a script has little time to ride on an unrelated tap;
|
|
242
|
+
/// Chromium's user activation lasts 5 s.
|
|
244
243
|
private let tapWindow: TimeInterval = 1
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import ExpoModulesCore
|
|
2
2
|
import WebKit
|
|
3
3
|
|
|
4
|
-
/// The scripts the view runs in the page: the injected scripts, `evaluate`, and the bridge transport (page ->
|
|
5
|
-
/// WKScriptMessageHandler,
|
|
4
|
+
/// The scripts the view runs in the page: the injected scripts, `evaluate`, and the bridge transport (page -> JS through a
|
|
5
|
+
/// WKScriptMessageHandler, JS -> page through callAsyncJavaScript). The bridge moves only the text, with the sender's
|
|
6
6
|
/// verified origin; the protocol (calls, results, events) is the page client's and createBridge's.
|
|
7
7
|
extension MinimalWebView {
|
|
8
8
|
/// The bridge's page client first, then the app's scripts in order, then the hooks' own. Changes take effect from the
|
|
@@ -60,7 +60,7 @@ extension MinimalWebView {
|
|
|
60
60
|
onBridge(["message": text, "origin": origin])
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
/// Delivers a message from
|
|
63
|
+
/// Delivers a message from JS to the page. Only to the allowed document that last posted (its page client says
|
|
64
64
|
/// `ready` first). The page checks its origin again at delivery time: the document may have changed since the post
|
|
65
65
|
/// was queued. A message for a page that is gone is dropped.
|
|
66
66
|
func bridgePost(_ text: String) {
|
package/ios/MinimalWebView.swift
CHANGED
|
@@ -2,7 +2,7 @@ import ExpoModulesCore
|
|
|
2
2
|
import WebKit
|
|
3
3
|
|
|
4
4
|
// swiftlint:disable file_length - because the view is the aggregate root: it holds what has one owner (the Expo surface, the platform WebView's life, crash recovery, the Document scope, the navigation state, the hook plumbing), and a feature with state of its own gets its own class
|
|
5
|
-
// swiftlint:disable:next type_body_length - because the view is the aggregate root
|
|
5
|
+
// swiftlint:disable:next type_body_length - because the view is the aggregate root, see the file_length reason above
|
|
6
6
|
class MinimalWebView: ExpoView, WKNavigationDelegate {
|
|
7
7
|
let onNavigationState = EventDispatcher()
|
|
8
8
|
let onBridge = EventDispatcher()
|
|
@@ -12,7 +12,7 @@ class MinimalWebView: ExpoView, WKNavigationDelegate {
|
|
|
12
12
|
let onNavigation = EventDispatcher()
|
|
13
13
|
|
|
14
14
|
// Props, applied together in applyProps(). The bridge, the hooks with a configure step and the `configuration`
|
|
15
|
-
// settings are fixed at mount
|
|
15
|
+
// settings are fixed at mount (see `webView`).
|
|
16
16
|
var source: WebViewSource?
|
|
17
17
|
var bridgeScript: String?
|
|
18
18
|
var bridgeOrigins: [String] = []
|
|
@@ -85,7 +85,7 @@ class MinimalWebView: ExpoView, WKNavigationDelegate {
|
|
|
85
85
|
var nextEvaluation = 0
|
|
86
86
|
|
|
87
87
|
// The origin of the document whose page client last posted, as `location.origin` writes it (`*` when every origin is
|
|
88
|
-
// allowed).
|
|
88
|
+
// allowed). JS's messages are delivered only while the page still has it.
|
|
89
89
|
var bridgeOrigin: String?
|
|
90
90
|
// The JS dialog on screen, and how to complete it if it has to go away. WebKit requires exactly one completion.
|
|
91
91
|
// While one is up the page is blocked, and an accessibility query into it (XCTest's) hangs: hide it.
|
|
@@ -176,8 +176,8 @@ class MinimalWebView: ExpoView, WKNavigationDelegate {
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
/// Loads a request the app started
|
|
180
|
-
///
|
|
179
|
+
/// Loads a request the app started (see `programmaticUrl`). A file URL goes through loadFileURL with the source's read
|
|
180
|
+
/// root, so the page's own assets load (load(_:) can't read local files).
|
|
181
181
|
func loadProgrammatic(_ request: URLRequest) {
|
|
182
182
|
programmaticUrl = request.url
|
|
183
183
|
if let url = request.url, url.isFileURL {
|
|
@@ -201,10 +201,11 @@ class MinimalWebView: ExpoView, WKNavigationDelegate {
|
|
|
201
201
|
if let webView, webView.url != nil, failedUrl == nil, !onPostSource { webView.reload() } else { loadAgain() }
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
///
|
|
205
|
-
///
|
|
206
|
-
///
|
|
207
|
-
///
|
|
204
|
+
/// Loads the page on screen again, as crash recovery does. In order:
|
|
205
|
+
/// - the `source`, when it is the page or nothing has committed (so its headers, POST body or html are used);
|
|
206
|
+
/// - else the failed URL;
|
|
207
|
+
/// - else the back-forward list's item (a dead web process relaunches with it, so history stays).
|
|
208
|
+
/// A `source` being prepared loads once it is ready instead.
|
|
208
209
|
private func loadAgain() {
|
|
209
210
|
guard let webView, !preparing else { return }
|
|
210
211
|
if let source, onSource || failedUrl == nil && webView.backForwardList.currentItem == nil {
|
|
@@ -216,7 +217,7 @@ class MinimalWebView: ExpoView, WKNavigationDelegate {
|
|
|
216
217
|
}
|
|
217
218
|
}
|
|
218
219
|
|
|
219
|
-
///
|
|
220
|
+
/// `source` loads from applyProps once the load is prepared.
|
|
220
221
|
private func createWebView() {
|
|
221
222
|
let configuration = WKWebViewConfiguration()
|
|
222
223
|
// The creation-time settings (`ios.configuration`) and the configure hooks go first and the bridge after them,
|
|
@@ -436,12 +437,12 @@ class MinimalWebView: ExpoView, WKNavigationDelegate {
|
|
|
436
437
|
}
|
|
437
438
|
|
|
438
439
|
/// The web content process died. The WKWebView survives it, so reload, unless it keeps crashing.
|
|
439
|
-
/// WebKit does not say whether it crashed or was killed for memory, so its `cause` is `unknown` on iOS.
|
|
440
440
|
func webViewWebContentProcessDidTerminate(_ webView: WKWebView) {
|
|
441
441
|
let recovered = Recovery.crashAllowsReload(&crashTimes, now: ProcessInfo.processInfo.systemUptime) && !onPostSource
|
|
442
442
|
endDocument(.crashed)
|
|
443
443
|
if lastEmitted?["loading"] as? Bool == true { outcome = "failed" } // the load the crash cut off
|
|
444
444
|
if recovered { loadAgain() }
|
|
445
|
+
// WebKit doesn't say whether it crashed or was killed for memory
|
|
445
446
|
onProcessGone(["cause": "unknown", "recovered": recovered])
|
|
446
447
|
forward { $0.webViewWebContentProcessDidTerminate?(webView) }
|
|
447
448
|
}
|
|
@@ -66,7 +66,7 @@ enum NavigationRules {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
private static func urlParts(_ scheme: String, _ url: String) -> Parts {
|
|
69
|
-
// shortcut: an unparseable URL has no host and path "/", so only host-less rules match
|
|
69
|
+
// shortcut: an unparseable URL has no host and path "/", so only host-less rules match; parse it by hand when a rule must match such URLs
|
|
70
70
|
let components = URLComponents(string: url)
|
|
71
71
|
let rawPath = components?.percentEncodedPath ?? ""
|
|
72
72
|
// No authority (`myapp:/abs`, `myapp:open`): the path is "/", as in Kotlin. `file:///x` has an empty one, not none.
|
package/ios/OriginRules.swift
CHANGED
|
@@ -5,8 +5,9 @@ import Foundation
|
|
|
5
5
|
/// Compared case-insensitively, a missing port is the scheme's default, and a malformed rule matches nothing.
|
|
6
6
|
/// createBridge validates the rules on the JS side. Cases: src/__tests__/vectors/origin-rules.json.
|
|
7
7
|
enum OriginRules {
|
|
8
|
-
/// The
|
|
9
|
-
///
|
|
8
|
+
/// The origin string of a frame, `scheme://host[:port]`, or `null` for an opaque origin (no scheme: an html source
|
|
9
|
+
/// without `baseUrl`, a sandboxed page). The default port is left out (WebKit reports it as 0) and an IPv6 host is
|
|
10
|
+
/// bracketed.
|
|
10
11
|
static func origin(_ scheme: String, _ host: String, _ port: Int) -> String {
|
|
11
12
|
guard !scheme.isEmpty else { return "null" }
|
|
12
13
|
let defaultPort = scheme == "https" ? 443 : scheme == "http" ? 80 : nil
|