@@ -27,6 +27,7 @@ import com.duckduckgo.app.browser.commands.Command.SendResponseToJs
27
27
import com.duckduckgo.app.browser.commands.Command.SendSubscriptions
28
28
import com.duckduckgo.app.browser.commands.NavigationCommand.Navigate
29
29
import com.duckduckgo.app.pixels.AppPixelName
30
+ import com.duckduckgo.app.pixels.AppPixelName.DUCK_PLAYER_JS_ERROR
30
31
import com.duckduckgo.app.pixels.AppPixelName.DUCK_PLAYER_SETTING_ALWAYS_DUCK_PLAYER
31
32
import com.duckduckgo.app.pixels.AppPixelName.DUCK_PLAYER_SETTING_ALWAYS_OVERLAY_YOUTUBE
32
33
import com.duckduckgo.app.pixels.AppPixelName.DUCK_PLAYER_SETTING_ALWAYS_SERP
@@ -191,6 +192,7 @@ class DuckPlayerJSHelper @Inject constructor(
191
192
tabId : String ,
192
193
isActiveCustomTab : Boolean ,
193
194
): Command ? {
195
+ logcat(" Cris" ) { " DuckPlayerJSHelper method: $method , data: $data " }
194
196
when (method) {
195
197
" getUserValues" -> if (id != null ) {
196
198
return SendResponseToJs (getUserPreferences(featureName, method, id))
@@ -291,7 +293,15 @@ class DuckPlayerJSHelper @Inject constructor(
291
293
pixel.fire(impressionPixelName)
292
294
pixel.fire(dailyPixelName, emptyMap(), emptyMap(), Daily ())
293
295
}
296
+ " reportMetric" -> {
297
+ val message = data?.getString(" message" )
298
+ val kind = data?.getString(" kind" )
299
+ if (message != null && kind != null ) {
300
+ pixel.fire(DUCK_PLAYER_JS_ERROR , mapOf (" message" to message, " kind" to kind))
301
+ }
302
+ }
294
303
else -> {
304
+ logcat(" Cris" ) { " Unhandled method: $method , data: $data " }
295
305
return null
296
306
}
297
307
}
0 commit comments