question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android hard crash with blob:// links

See original GitHub issue

Bug description:

Getting a hard crash on Android (see log below) when the webview tries to open a blob link.

In addition, the onShouldStartLoadWithRequest prop is not called which I’m also using to stop blob links from even running.

java.lang.IllegalArgumentException Can only download HTTP/HTTPS URIs: blob:https://app.zinspector.com/b20a08ad-41c7-4d93-bd14-2280b9d96d2c 
    DownloadManager.java:614 android.app.DownloadManager$Request.<init>
    RNCWebViewManager.java:199 com.reactnativecommunity.webview.RNCWebViewManager$2.onDownloadStart
    PG:537 sV.a
    PG:25 aHF.handleMessage
    Handler.java:106 android.os.Handler.dispatchMessage
    Looper.java:164 android.os.Looper.loop
    ActivityThread.java:7000 android.app.ActivityThread.main
    Method.java:-2 java.lang.reflect.Method.invoke
    RuntimeInit.java:441 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run
    ZygoteInit.java:1408 com.android.internal.os.ZygoteInit.main

To Reproduce:

Test the webview with any page that as a blob download.

Expected behavior:

First, it shouldn’t crash with a blob:// link. Secondly, at least onShouldStartLoadWithRequest should be called so we can prevent the link from running.

Screenshots/Videos:

Environment:

  • OS: Android
  • OS version: 8.1, 9, 10
  • react-native version: 0.61.5
  • react-native-webview version: 7.6.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
cristianoccazinspcommented, Mar 18, 2020

Please re-open, this is still happening 😦

2reactions
cristianoccazinspcommented, Mar 10, 2020

Although the above is a nice workaround, this is still an issue and can’t be worked around like that all the time (e.g., a google maps viewer). Not looking for a definite solution, but at least a try/catch in the native code would be awesome.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to read the data in a Blob in WebView on Android?
Yes, it should be possible. In your case, the URL looks like this, once the blob: prefix is removed, and the rest is...
Read more >
447414 - history.pushState / replaceState with blob - Monorail
This is caused by the fact that pushState access control uses SecurityOrigin::canRequest, which allows access to same-origin blob URLs.
Read more >
[GUIDE] Ultimate fix for Google Family Link onboarding loop
tl;dr: When using opengapps copy https://gitlab.opengapps.org/opengapps/all/-/blob/master/product/overlay/PlayStoreOverlay.apk to /system/ ...
Read more >
Illustrator system requirements - Adobe Support
RAM. 8 GB of RAM (16 GB recommended) ; Hard disk. 2 GB of available hard-disk space for installation; additional free space required...
Read more >
react-native-blob-util - npm
For very old devices android devices okhttp 3.12 can be used. Manually Link Native Modules. If you're using RN 0.60 or higher, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found