Skip to content

Commit afcb27d

Browse files
committed
Add web message listener for js call from bookmark import
1 parent ad86905 commit afcb27d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

autofill/autofill-impl/src/main/java/com/duckduckgo/autofill/impl/importing/takeout/webflow/ImportGoogleBookmarksWebFlowFragment.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,11 @@ class ImportGoogleBookmarksWebFlowFragment :
324324
} else {
325325
logcat(WARN) { "Bookmark-import: Not able to inject bookmark import JavaScript" }
326326
}
327+
328+
WebViewCompat.addWebMessageListener(webView, "ddgBookmarkImport", setOf("*")) { _, message, sourceOrigin, _, _ ->
329+
val data = message.data ?: return@addWebMessageListener
330+
logcat { "Bookmark-import: Received web message from ${sourceOrigin.host}: $data" }
331+
}
327332
}
328333

329334
private fun initialiseToolbar() {

0 commit comments

Comments
 (0)