react-native-minimal-webview 1.2.1 → 1.3.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/android/build.gradle +1 -1
- package/android/src/main/java/expo/modules/minimalwebview/Asks.kt +5 -11
- package/android/src/main/java/expo/modules/minimalwebview/Hooks.kt +17 -11
- package/android/src/main/java/expo/modules/minimalwebview/MinimalWebView.kt +67 -120
- package/android/src/main/java/expo/modules/minimalwebview/MinimalWebViewClients.kt +23 -32
- package/android/src/main/java/expo/modules/minimalwebview/MinimalWebViewModule.kt +8 -18
- package/android/src/main/java/expo/modules/minimalwebview/MinimalWebViewNavigation.kt +30 -49
- package/android/src/main/java/expo/modules/minimalwebview/MinimalWebViewScripts.kt +48 -36
- package/android/src/main/java/expo/modules/minimalwebview/NavigationRules.kt +19 -20
- package/android/src/main/java/expo/modules/minimalwebview/PlatformSettings.kt +30 -40
- package/android/src/main/java/expo/modules/minimalwebview/PullToRefresh.kt +14 -18
- package/android/src/main/java/expo/modules/minimalwebview/requests/Downloads.kt +12 -23
- package/android/src/main/java/expo/modules/minimalwebview/requests/FileUpload.kt +0 -1
- package/android/src/main/java/expo/modules/minimalwebview/requests/FullscreenVideo.kt +1 -4
- package/android/src/main/java/expo/modules/minimalwebview/requests/Permissions.kt +34 -24
- package/build/WebView.d.ts +8 -1
- package/build/WebView.d.ts.map +1 -1
- package/build/WebView.js +30 -80
- package/build/WebView.js.map +1 -1
- package/build/bridge/createBridge.d.ts +1 -5
- package/build/bridge/createBridge.d.ts.map +1 -1
- package/build/bridge/createBridge.js +3 -15
- package/build/bridge/createBridge.js.map +1 -1
- package/build/bridge/endpoint.d.ts +1 -2
- package/build/bridge/endpoint.d.ts.map +1 -1
- package/build/bridge/endpoint.js +5 -6
- package/build/bridge/endpoint.js.map +1 -1
- package/build/bridge/matchesOrigin.d.ts +11 -0
- package/build/bridge/matchesOrigin.d.ts.map +1 -0
- package/build/bridge/matchesOrigin.js +26 -0
- package/build/bridge/matchesOrigin.js.map +1 -0
- package/build/bridge/origins.d.ts +2 -13
- package/build/bridge/origins.d.ts.map +1 -1
- package/build/bridge/origins.js +1 -30
- 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 +2 -2
- package/build/bridge/pageClient.generated.js.map +1 -1
- package/build/bridge/protocol.d.ts +3 -5
- package/build/bridge/protocol.d.ts.map +1 -1
- package/build/bridge/protocol.js +12 -14
- package/build/bridge/protocol.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js +1 -1
- package/build/navigationRules.d.ts +0 -5
- package/build/navigationRules.d.ts.map +1 -1
- package/build/navigationRules.js +3 -12
- package/build/navigationRules.js.map +1 -1
- package/build/reactNativeWebViewDefaults.d.ts +0 -4
- package/build/reactNativeWebViewDefaults.d.ts.map +1 -1
- package/build/reactNativeWebViewDefaults.js +0 -4
- package/build/reactNativeWebViewDefaults.js.map +1 -1
- package/build/reactNativeWebViewMessages.d.ts.map +1 -1
- package/build/reactNativeWebViewMessages.js +0 -1
- package/build/reactNativeWebViewMessages.js.map +1 -1
- package/build/refStore.d.ts +0 -2
- package/build/refStore.d.ts.map +1 -1
- package/build/refStore.js +0 -6
- package/build/refStore.js.map +1 -1
- package/build/types.d.ts +33 -16
- package/build/types.d.ts.map +1 -1
- package/ios/Asks.swift +6 -9
- package/ios/DelegateProxy.swift +6 -20
- package/ios/DownloadName.swift +0 -2
- package/ios/Downloads.swift +0 -2
- package/ios/Hooks.swift +6 -7
- package/ios/Loads.swift +37 -19
- package/ios/MinimalWebView+Dialogs.swift +2 -6
- package/ios/MinimalWebView+Navigation.swift +25 -57
- package/ios/MinimalWebView+Scripts.swift +4 -16
- package/ios/MinimalWebView.podspec +1 -2
- package/ios/MinimalWebView.swift +58 -144
- package/ios/MinimalWebViewModule.swift +1 -18
- package/ios/NavigationRules.swift +2 -9
- package/ios/OriginRules.swift +4 -13
- package/ios/PlatformSettings.swift +19 -38
- package/ios/ReadAccess.swift +0 -2
- package/ios/Records.swift +18 -0
- package/ios/Recovery.swift +2 -8
- package/ios/SharedCookies.swift +10 -25
- package/package.json +4 -4
- package/src/WebView.tsx +45 -95
- package/src/bridge/createBridge.ts +5 -20
- package/src/bridge/endpoint.ts +6 -9
- package/src/bridge/matchesOrigin.ts +27 -0
- package/src/bridge/origins.ts +2 -30
- package/src/bridge/pageClient.generated.ts +2 -2
- package/src/bridge/pageClient.ts +1 -7
- package/src/bridge/protocol.ts +16 -18
- package/src/index.ts +1 -1
- package/src/navigationRules.ts +6 -12
- package/src/reactNativeWebViewDefaults.ts +0 -4
- package/src/reactNativeWebViewMessages.ts +0 -1
- package/src/refStore.ts +0 -7
- package/src/types.ts +33 -16
|
@@ -2,25 +2,22 @@ import UIKit
|
|
|
2
2
|
import UIKit.UIGestureRecognizerSubclass
|
|
3
3
|
import WebKit
|
|
4
4
|
|
|
5
|
-
/// Navigation rules, `ask`, new windows and external opening. The decision handler is held while JS answers an
|
|
6
|
-
/// `ask`, called exactly once, and blocked after 1 s or when the WebView goes away.
|
|
7
5
|
extension MinimalWebView {
|
|
8
|
-
func
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
let
|
|
15
|
-
if
|
|
6
|
+
func webView(
|
|
7
|
+
_ webView: WKWebView,
|
|
8
|
+
decidePolicyFor action: WKNavigationAction,
|
|
9
|
+
decisionHandler decide: @escaping @MainActor (WKNavigationActionPolicy) -> Void
|
|
10
|
+
) {
|
|
11
|
+
// A new window (no target frame) is decided in createWebViewWith.
|
|
12
|
+
guard let target = action.request.url, let targetFrame = action.targetFrame else { return decide(allowInPlace) }
|
|
13
|
+
if takeOwnLoad(action) || action.navigationType == .backForward || action.navigationType == .reload
|
|
16
14
|
|| action.request.httpMethod == "POST" {
|
|
17
15
|
return decide(allowInPlace)
|
|
18
16
|
}
|
|
19
17
|
let request = NavigationRules.Request(
|
|
20
|
-
url: target.absoluteString, mainFrame:
|
|
18
|
+
url: target.absoluteString, mainFrame: targetFrame.isMainFrame, newWindow: false, userInitiated: userInitiated(action)
|
|
21
19
|
)
|
|
22
|
-
//
|
|
23
|
-
// http(s) one opens outside the WebView (openDownload): .allow would show it as a page.
|
|
20
|
+
// `.allow` would show a navigation WebKit marks as a download (`<a download>`, blob:) as a page.
|
|
24
21
|
let download = action.shouldPerformDownload && requestHandlers.contains("onDownload")
|
|
25
22
|
let dropped = action.shouldPerformDownload && !download
|
|
26
23
|
run(request) { [weak self] allowed in
|
|
@@ -33,33 +30,24 @@ extension MinimalWebView {
|
|
|
33
30
|
}
|
|
34
31
|
}
|
|
35
32
|
|
|
36
|
-
/// Counts a main-frame policy check, whoever decides it, and takes the own load (`ownLoads`) it is for: whether it is one.
|
|
37
33
|
func takeOwnLoad(_ action: WKNavigationAction) -> Bool {
|
|
38
34
|
guard action.targetFrame?.isMainFrame == true, let target = action.request.url else { return false }
|
|
39
|
-
|
|
40
|
-
guard let own = ownLoads.firstIndex(where: { Loads.sameURL($0.url, target) }) else { return false }
|
|
41
|
-
ownLoads.remove(at: own)
|
|
42
|
-
return true
|
|
35
|
+
return ownLoads.check(target)
|
|
43
36
|
}
|
|
44
37
|
|
|
45
|
-
///
|
|
46
|
-
///
|
|
47
|
-
/// including a link a script clicks (`element.click()`), and no public WKNavigationAction property tells a real one
|
|
48
|
-
/// apart.
|
|
38
|
+
/// WebKit reports a link a script clicks (`element.click()`) as `.linkActivated` too, and no public
|
|
39
|
+
/// WKNavigationAction property tells a real one apart.
|
|
49
40
|
private func userInitiated(_ action: WKNavigationAction) -> Bool {
|
|
50
41
|
action.navigationType == .linkActivated
|
|
51
42
|
&& (taps.recent || UIAccessibility.isVoiceOverRunning || UIAccessibility.isSwitchControlRunning)
|
|
52
43
|
}
|
|
53
44
|
|
|
54
|
-
/// A download no `onDownload` takes.
|
|
55
45
|
func openDownload(_ url: URL) {
|
|
56
46
|
guard ["http", "https"].contains(url.scheme?.lowercased()) else { return }
|
|
57
47
|
let request = NavigationRules.Request(url: url.absoluteString, mainFrame: true, newWindow: false, userInitiated: false)
|
|
58
48
|
finish(request, .external, nil) { _ in }
|
|
59
49
|
}
|
|
60
50
|
|
|
61
|
-
/// window.open and target=_blank. Never a second WKWebView: a popup model (presenting and closing a child,
|
|
62
|
-
/// `window.opener`, its own rules and bridge) is more than almost any app wants.
|
|
63
51
|
func webView(
|
|
64
52
|
_ webView: WKWebView,
|
|
65
53
|
createWebViewWith configuration: WKWebViewConfiguration,
|
|
@@ -76,7 +64,6 @@ extension MinimalWebView {
|
|
|
76
64
|
|
|
77
65
|
private func openWindow(_ request: URLRequest, _ userInitiated: Bool) {
|
|
78
66
|
guard let target = request.url else { return }
|
|
79
|
-
// This load is the app's, past WebKit's limits on what a page may load, so only an http(s) POST skips the rules.
|
|
80
67
|
if request.httpMethod == "POST", ["http", "https"].contains(target.scheme?.lowercased()) {
|
|
81
68
|
return loadProgrammatic(request)
|
|
82
69
|
}
|
|
@@ -90,8 +77,7 @@ extension MinimalWebView {
|
|
|
90
77
|
|
|
91
78
|
/// Applies the rules (and `ask`) to a request and reports the outcome; `completion` gets whether to load it here.
|
|
92
79
|
private func run(_ request: NavigationRules.Request, completion: @escaping (Bool) -> Void) {
|
|
93
|
-
//
|
|
94
|
-
// redirect flag, so a tap on that URL isn't asked again either; Android skips only redirects.
|
|
80
|
+
// WebKit has no redirect flag: a URL an `ask` allowed isn't asked again until the next main-frame commit.
|
|
95
81
|
let decision = NavigationRules.decide(
|
|
96
82
|
navigationRules, request, asked: askedAndAllowed[request.mainFrame] ?? [],
|
|
97
83
|
canAsk: requestHandlers.contains("onNavigationRequest")
|
|
@@ -100,14 +86,13 @@ extension MinimalWebView {
|
|
|
100
86
|
finish(request, decision.action, decision.rule, completion)
|
|
101
87
|
return
|
|
102
88
|
}
|
|
103
|
-
let
|
|
104
|
-
// The view can be gone: the decision handler must still be called.
|
|
89
|
+
let asked = asks.ask("core", "onNavigationRequest", request.payload) { [weak self] answer in
|
|
105
90
|
guard let self else { return completion(false) }
|
|
106
91
|
let action = NavigationRules.answer(answer)
|
|
107
92
|
if action == .allow { self.askedAndAllowed[request.mainFrame, default: []].insert(request.url) }
|
|
108
93
|
self.finish(request, action, decision.rule, completion)
|
|
109
94
|
}
|
|
110
|
-
|
|
95
|
+
guard let id = asked else { return }
|
|
111
96
|
DispatchQueue.main.asyncAfter(deadline: .now() + askTimeout) { [weak self] in
|
|
112
97
|
self?.asks.cancel(id)
|
|
113
98
|
}
|
|
@@ -119,13 +104,11 @@ extension MinimalWebView {
|
|
|
119
104
|
completion(action == .allow)
|
|
120
105
|
guard action == .external else { return report(request, action, rule) }
|
|
121
106
|
guard requestHandlers.contains("onOpenExternal") else { return open(request, rule) }
|
|
122
|
-
// A page that moved on first answers nil, which counts as opened. No timeout: nothing waits for the answer.
|
|
123
107
|
asks.ask("core", "onOpenExternal", request.payload) { [weak self] answer in
|
|
124
108
|
if answer as? Bool == false { self?.open(request, rule) } else { self?.report(request, .external, rule) }
|
|
125
109
|
}
|
|
126
110
|
}
|
|
127
111
|
|
|
128
|
-
/// Opens an `external` URL outside the WebView. As on Android, one that nothing opens is reported as blocked.
|
|
129
112
|
private func open(_ request: NavigationRules.Request, _ rule: Int?) {
|
|
130
113
|
guard let url = URL(string: request.url) else { return report(request, .block, rule) }
|
|
131
114
|
UIApplication.shared.open(url) { [weak self] opened in self?.report(request, opened ? .external : .block, rule) }
|
|
@@ -139,10 +122,7 @@ extension MinimalWebView {
|
|
|
139
122
|
|
|
140
123
|
private let askTimeout: TimeInterval = 1
|
|
141
124
|
|
|
142
|
-
///
|
|
143
|
-
/// async popup payment buttons do. WebKit needs a WKWebView for it, made from the configuration it passes. It is
|
|
144
|
-
/// never shown: it cancels its first navigation, hands the request on and goes. One that hasn't navigated within 5 s,
|
|
145
|
-
/// or that the page closes, goes unused.
|
|
125
|
+
/// WebKit needs a WKWebView made from the configuration it passes for a `window.open('')` the page navigates later.
|
|
146
126
|
private final class WindowCatcher: NSObject, WKNavigationDelegate, WKUIDelegate {
|
|
147
127
|
private var child: WKWebView?
|
|
148
128
|
private var caught: ((URLRequest) -> Void)?
|
|
@@ -153,7 +133,7 @@ private final class WindowCatcher: NSObject, WKNavigationDelegate, WKUIDelegate
|
|
|
153
133
|
child.navigationDelegate = catcher
|
|
154
134
|
child.uiDelegate = catcher
|
|
155
135
|
(catcher.child, catcher.caught) = (child, caught)
|
|
156
|
-
//
|
|
136
|
+
// WKWebView's delegates are weak: the timer holds the catcher.
|
|
157
137
|
DispatchQueue.main.asyncAfter(deadline: .now() + newWindowTimeout) { catcher.drop() }
|
|
158
138
|
return child
|
|
159
139
|
}
|
|
@@ -184,17 +164,12 @@ private final class WindowCatcher: NSObject, WKNavigationDelegate, WKUIDelegate
|
|
|
184
164
|
|
|
185
165
|
private let newWindowTimeout: TimeInterval = 5
|
|
186
166
|
|
|
187
|
-
/// WebKit's private `_WKNavigationActionPolicyAllowWithoutTryingAppLink` (allow + 2)
|
|
188
|
-
///
|
|
189
|
-
///
|
|
190
|
-
/// `?? .allow` only satisfies the type: nothing falls back if WebKit drops the value.
|
|
167
|
+
/// WebKit's private `_WKNavigationActionPolicyAllowWithoutTryingAppLink` (allow + 2): `.allow` would hand a tapped
|
|
168
|
+
/// link to an installed app that claims it as a universal link.
|
|
169
|
+
/// `init(rawValue:)` accepts any value, so the fallback never applies.
|
|
191
170
|
private let allowInPlace = WKNavigationActionPolicy(rawValue: WKNavigationActionPolicy.allow.rawValue + 2) ?? .allow
|
|
192
171
|
|
|
193
|
-
/// When a tap on the WKWebView last ended, for `userInitiated`. It only watches the view's touches and never
|
|
194
|
-
/// recognizes, so it cancels, delays and prevents nothing (scrolling, links, text selection and the pull-to-refresh
|
|
195
|
-
/// control work as without it). It fails at each touch's end, or as soon as the touch scrolls.
|
|
196
172
|
final class Taps: UIGestureRecognizer, UIGestureRecognizerDelegate {
|
|
197
|
-
/// System uptime, so a change of the device time doesn't affect it.
|
|
198
173
|
private var lastTap: TimeInterval = -.infinity
|
|
199
174
|
|
|
200
175
|
override init(target: Any?, action: Selector?) {
|
|
@@ -204,7 +179,6 @@ final class Taps: UIGestureRecognizer, UIGestureRecognizerDelegate {
|
|
|
204
179
|
delegate = self
|
|
205
180
|
}
|
|
206
181
|
|
|
207
|
-
/// A tap ended within `tapWindow`.
|
|
208
182
|
var recent: Bool { ProcessInfo.processInfo.systemUptime - lastTap <= tapWindow }
|
|
209
183
|
|
|
210
184
|
override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent) {
|
|
@@ -223,9 +197,7 @@ final class Taps: UIGestureRecognizer, UIGestureRecognizerDelegate {
|
|
|
223
197
|
state = .failed
|
|
224
198
|
}
|
|
225
199
|
|
|
226
|
-
///
|
|
227
|
-
/// tap, as in Chromium, where lifting a finger after a scroll gives the page no user activation
|
|
228
|
-
/// (pointer_event_manager.cc).
|
|
200
|
+
/// WebKit gives the page and each scrollable box in it its own UIScrollView.
|
|
229
201
|
private func scrolls(_ touches: Set<UITouch>) -> Bool {
|
|
230
202
|
touches.contains { touch in
|
|
231
203
|
touch.gestureRecognizers?.contains { recognizer in
|
|
@@ -235,8 +207,7 @@ final class Taps: UIGestureRecognizer, UIGestureRecognizerDelegate {
|
|
|
235
207
|
}
|
|
236
208
|
}
|
|
237
209
|
|
|
238
|
-
///
|
|
239
|
-
/// this one watching instead of failing it.
|
|
210
|
+
/// WebKit's touch events recognizer begins at touch down, which would otherwise fail this one.
|
|
240
211
|
func gestureRecognizer(
|
|
241
212
|
_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith other: UIGestureRecognizer
|
|
242
213
|
) -> Bool {
|
|
@@ -244,9 +215,6 @@ final class Taps: UIGestureRecognizer, UIGestureRecognizerDelegate {
|
|
|
244
215
|
}
|
|
245
216
|
}
|
|
246
217
|
|
|
247
|
-
///
|
|
248
|
-
///
|
|
249
|
-
/// one that can zoom. The link's decision then follows from the web content process. The window covers a busy page
|
|
250
|
-
/// and a redirect of the tapped link. It stays short so a script has little time to ride on an unrelated tap;
|
|
251
|
-
/// Chromium's user activation lasts 5 s.
|
|
218
|
+
/// WebKit sends the click after its double-tap wait (about 350 ms) on a page that can zoom, and the link's decision
|
|
219
|
+
/// follows from the web content process.
|
|
252
220
|
private let tapWindow: TimeInterval = 1
|
|
@@ -1,12 +1,7 @@
|
|
|
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 -> JS through a
|
|
5
|
-
/// WKScriptMessageHandler, JS -> page through callAsyncJavaScript). The bridge moves only the text, with the sender's
|
|
6
|
-
/// verified origin; the protocol (calls, results, events) is the page client's and createBridge's.
|
|
7
4
|
extension MinimalWebView {
|
|
8
|
-
/// The bridge's page client first, then the app's scripts in order, then the hooks' own. Changes take effect from the
|
|
9
|
-
/// next navigation.
|
|
10
5
|
func installScripts(_ controller: WKUserContentController) {
|
|
11
6
|
// WebKit can only remove every script: take the hooks' out and add them back after the core's.
|
|
12
7
|
let hooks = controller.userScripts.filter { script in !ownScripts.contains { $0 === script } }
|
|
@@ -22,8 +17,7 @@ extension MinimalWebView {
|
|
|
22
17
|
(ownScripts + hooks).forEach { controller.addUserScript($0) }
|
|
23
18
|
}
|
|
24
19
|
|
|
25
|
-
///
|
|
26
|
-
/// away seconds later or never.
|
|
20
|
+
/// WebKit settles a call whose page went away seconds later or never.
|
|
27
21
|
func evaluate(_ script: String, _ promise: Promise) {
|
|
28
22
|
guard let webView else { return promise.reject("unavailable", "No WebView") }
|
|
29
23
|
let id = nextEvaluation
|
|
@@ -31,12 +25,11 @@ extension MinimalWebView {
|
|
|
31
25
|
evaluations[id] = promise
|
|
32
26
|
let body = "return ((v) => { try { return JSON.stringify(v) ?? 'null' } catch { return 'null' } })(await (\n\(script)\n))"
|
|
33
27
|
webView.callAsyncJavaScript(body, arguments: [:], in: nil, in: .page) { [weak self] result in
|
|
34
|
-
// Already rejected when its page went away.
|
|
35
28
|
guard let promise = self?.evaluations.removeValue(forKey: id) else { return }
|
|
36
29
|
switch result {
|
|
37
30
|
case .success(let value): promise.resolve(value as? String ?? "null")
|
|
38
31
|
case .failure(let error):
|
|
39
|
-
//
|
|
32
|
+
// WebKit's localizedDescription is generic.
|
|
40
33
|
let message = (error as NSError).userInfo["WKJavaScriptExceptionMessage"] as? String ?? error.localizedDescription
|
|
41
34
|
// WebKit drops the call of a page being left, and (iOS 27) can say so before didCommit.
|
|
42
35
|
if message == Self.unreachable, self?.webView?.isLoading == true { return promise.reject("navigated", Self.navigated) }
|
|
@@ -45,7 +38,6 @@ extension MinimalWebView {
|
|
|
45
38
|
}
|
|
46
39
|
}
|
|
47
40
|
|
|
48
|
-
/// The page the waiting `evaluate` calls run in is gone.
|
|
49
41
|
func failEvaluations() {
|
|
50
42
|
let waiting = evaluations.values
|
|
51
43
|
evaluations = [:]
|
|
@@ -57,17 +49,13 @@ extension MinimalWebView {
|
|
|
57
49
|
|
|
58
50
|
func bridgeReceive(_ message: WKScriptMessage) {
|
|
59
51
|
let origin = OriginRules.origin(of: message.frameInfo.securityOrigin)
|
|
60
|
-
//
|
|
52
|
+
// A window.open('') view (WindowCatcher) shares the content controller.
|
|
61
53
|
guard message.webView === webView, message.frameInfo.isMainFrame, OriginRules.allows(bridgeOrigins, origin),
|
|
62
54
|
let text = message.body as? String else { return }
|
|
63
|
-
// `*` allows every document, opaque ones too (whose location.origin is "null"): nothing to compare.
|
|
64
55
|
bridgeOrigin = bridgeOrigins.contains("*") ? "*" : origin
|
|
65
56
|
onBridge(["message": text, "origin": origin])
|
|
66
57
|
}
|
|
67
58
|
|
|
68
|
-
/// Delivers a message from JS to the page. Only to the allowed document that last posted (its page client says
|
|
69
|
-
/// `ready` first). The page checks its origin again at delivery time: the document may have changed since the post
|
|
70
|
-
/// was queued. A message for a page that is gone is dropped.
|
|
71
59
|
func bridgePost(_ text: String) {
|
|
72
60
|
guard let bridgeOrigin else { return }
|
|
73
61
|
let deliver = "if (origin === '*' || location.origin === origin) window.nativeBridge?.__receive(message)"
|
|
@@ -75,7 +63,7 @@ extension MinimalWebView {
|
|
|
75
63
|
}
|
|
76
64
|
}
|
|
77
65
|
|
|
78
|
-
///
|
|
66
|
+
/// WKUserContentController retains its handlers.
|
|
79
67
|
final class WeakBridgeHandler: NSObject, WKScriptMessageHandler {
|
|
80
68
|
weak var view: MinimalWebView?
|
|
81
69
|
|
|
@@ -12,8 +12,7 @@ Pod::Spec.new do |s|
|
|
|
12
12
|
s.platforms = {
|
|
13
13
|
:ios => '17.0'
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
s.source = { git: repository.is_a?(Hash) ? repository['url'] : repository } # npm pkg fix makes it a Hash
|
|
15
|
+
s.source = { git: package['repository'] }
|
|
17
16
|
s.static_framework = true
|
|
18
17
|
|
|
19
18
|
s.dependency 'ExpoModulesCore'
|