Skip to content

Commit 31428a9

Browse files
committed
fix: Disable interception blob: URLs leading to an Android crash
While the reason for why the `blob:` requests trigger is unknown, they originate when utilizing the block inserter's Patterns tab. The requests seemingly originate from the embedded editor previews rendered for each pattern.
1 parent e02f4e6 commit 31428a9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

android/Gutenberg/src/main/java/org/wordpress/gutenberg/GutenbergView.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ class GutenbergView : WebView {
115115

116116
override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
117117
url?.let {
118+
// Allow the WebView to handle `blob:` requests, which are utilized in the block
119+
// inserter's Patterns tab
120+
if (it.startsWith("blob:")) {
121+
return false
122+
}
118123
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(it))
119124
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
120125
view?.context?.startActivity(intent)

0 commit comments

Comments
 (0)