We have list of download links with base64 encoded string in the href with download attribute which works well in the browser but in Webview it gives error.
Here is the webview code
<WebView style={styles.WebView}
useWebKit={true}
source={{ uri: url }}
javaScriptEnabled={true}
domStorageEnabled={true}
decelerationRate="normal"
startInLoadingState={true}
// originWhitelist={['*']}
originWhitelist={['http://*','https://*', 'git://*',"file://"]}
mixedContentMode="compatibility"
injectedJavaScript={INJECTEDJAVASCRIPT}
mediaPlaybackRequiresUserAction={false}
allowsInlineMediaPlayback={true}
allowFileAccess={true}
allowUniversalAccessFromFileURLs={true}
onNavigationStateChange={
(newNavState) => {
console.log('TEST');
}
}
// onShouldStartLoadWithRequest={this.onLoadStart}
/>
Here is the Error I get
How Can I intercept the link and decode the base64 string to file and save in mobile? Thanks.