@@ -102,31 +102,31 @@ class RNCWebViewManagerImpl(private val newArch: Boolean = false) {
102
102
if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .O ) {
103
103
webView.setImportantForAutofill(View .IMPORTANT_FOR_AUTOFILL_NO );
104
104
}
105
- val base64DownloaderRequestFilePermission = { base64: String ->
106
- webView.reactApplicationContext.getNativeModule(RNCWebViewModule ::class .java)?.let { module ->
107
- module.setBase64DownloadRequest(base64)
108
- module.grantFileDownloaderPermissions(getDownloadingMessageOrDefault(), getLackPermissionToDownloadMessageOrDefault())
109
- }
110
- Unit
111
- }
112
- webView.addBlobFileDownloaderJavascriptInterface(
113
- downloadingMessage = getDownloadingMessageOrDefault(),
114
- requestFilePermission = base64DownloaderRequestFilePermission,
115
- )
116
- webView.setDownloadListener(DownloadListener { url, userAgent, contentDisposition, mimetype, contentLength ->
117
- if (url.startsWith(" data:" )) {
118
- Base64FileDownloader .downloadBase64File(
119
- context = context,
120
- base64 = url,
121
- downloadingMessage = getDownloadingMessageOrDefault(),
122
- requestFilePermission = base64DownloaderRequestFilePermission,
123
- )
124
- return @DownloadListener
125
- }
126
- if (url.startsWith(" blob:" )) {
127
- webView.evaluateJavascriptWithFallback(BlobFileDownloader .getBase64StringFromBlobUrl(url))
128
- return @DownloadListener
129
- }
105
+ val base64DownloaderRequestFilePermission = { base64: String ->
106
+ webView.reactApplicationContext.getNativeModule(RNCWebViewModule ::class .java)?.let { module ->
107
+ module.setBase64DownloadRequest(base64)
108
+ module.grantFileDownloaderPermissions(getDownloadingMessageOrDefault(), getLackPermissionToDownloadMessageOrDefault())
109
+ }
110
+ Unit
111
+ }
112
+ webView.addBlobFileDownloaderJavascriptInterface(
113
+ downloadingMessage = getDownloadingMessageOrDefault(),
114
+ requestFilePermission = base64DownloaderRequestFilePermission,
115
+ )
116
+ webView.setDownloadListener(DownloadListener { url, userAgent, contentDisposition, mimetype, contentLength ->
117
+ if (url.startsWith(" data:" )) {
118
+ Base64FileDownloader .downloadBase64File(
119
+ context = context,
120
+ base64 = url,
121
+ downloadingMessage = getDownloadingMessageOrDefault(),
122
+ requestFilePermission = base64DownloaderRequestFilePermission,
123
+ )
124
+ return @DownloadListener
125
+ }
126
+ if (url.startsWith(" blob:" )) {
127
+ webView.evaluateJavascriptWithFallback(BlobFileDownloader .getBase64StringFromBlobUrl(url))
128
+ return @DownloadListener
129
+ }
130
130
webView.setIgnoreErrFailedForThisURL(url)
131
131
val module = webView.reactApplicationContext.getNativeModule(RNCWebViewModule ::class .java) ? : return @DownloadListener
132
132
val request: DownloadManager .Request = try {
0 commit comments