File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed
content-scope-scripts/content-scope-scripts-api/src/main/java/com/duckduckgo/contentscopescripts/api
js-messaging/js-messaging-api/src/main/java/com/duckduckgo/js/messaging/api Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,13 @@ interface GlobalContentScopeJsMessageHandlersPlugin {
38
38
interface GlobalJsMessageHandler {
39
39
40
40
/* *
41
- * Processes a global message.
41
+ * Processes a global message received by the WebView.
42
+ *
43
+ * This method is responsible for handling a [JsMessage] and optionally
44
+ * invoking a callback so consumers can also process the message if needed.
45
+ *
46
+ * @param jsMessage The JavaScript message to be processed.
47
+ * @param jsMessageCallback An optional callback to handle the result of the message processing.
42
48
*/
43
49
fun process (
44
50
jsMessage : JsMessage ,
Original file line number Diff line number Diff line change @@ -21,9 +21,18 @@ import android.webkit.WebView
21
21
interface AdsjsMessaging {
22
22
23
23
/* *
24
- * Method to register the JS interface to the webView instance
24
+ * Register the JS interface to the webView instance
25
+ *
26
+ * @param webView WebView instance where the interface will be added
27
+ * @param jsMessageCallback Optional callback to handle messages
25
28
*/
26
29
suspend fun register (webView : WebView , jsMessageCallback : JsMessageCallback ? )
30
+
31
+ /* *
32
+ * Unregister the JS interface from the webView instance
33
+ *
34
+ * @param webView WebView instance where the interface will be removed
35
+ */
27
36
suspend fun unregister (webView : WebView )
28
37
29
38
/* *
@@ -39,7 +48,13 @@ interface AdsjsMessaging {
39
48
40
49
interface AdsjsMessageHandler {
41
50
/* *
42
- * This method processes a [JsMessage]
51
+ * Processes a JavaScript message received by the WebView.
52
+ *
53
+ * This method is responsible for handling a [JsMessage] and optionally
54
+ * invoking a callback so consumers can also process the message if needed.
55
+ *
56
+ * @param jsMessage The JavaScript message to be processed.
57
+ * @param jsMessageCallback An optional callback to handle the result of the message processing.
43
58
*/
44
59
fun process (
45
60
jsMessage : JsMessage ,
You can’t perform that action at this time.
0 commit comments