Skip to content

Commit

Permalink
Log Duck Player errors
Browse files Browse the repository at this point in the history
  • Loading branch information
CrisBarreiro committed Jul 30, 2024
1 parent 2057954 commit 40fc837
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import com.duckduckgo.duckplayer.api.DuckPlayer
import com.duckduckgo.js.messaging.api.JsCallbackData
import javax.inject.Inject
import org.json.JSONObject
import timber.log.Timber

const val DUCK_PLAYER_PAGE_FEATURE_NAME = "duckPlayerPage"
const val DUCK_PLAYER_FEATURE_NAME = "duckPlayer"
Expand Down Expand Up @@ -155,6 +156,9 @@ class DuckPlayerJSHelper @Inject constructor(
"openSettings" -> {
return OpenDuckPlayerSettings
}
"reportPageException", "reportInitException" -> {
Timber.tag(method).d(data.toString())
}
else -> {
return null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ class ContentScopeScriptsJsMessaging @Inject constructor(

override val allowedDomains: List<String> = emptyList()
override val featureName: String = "duckPlayer"
override val methods: List<String> = listOf("getUserValues", "sendDuckPlayerPixel", "setUserValues", "openDuckPlayer", "initialSetup")
override val methods: List<String> = listOf(
"getUserValues",
"sendDuckPlayerPixel",
"setUserValues",
"openDuckPlayer",
"initialSetup",
"reportPageException",
"reportInitException",
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ class DuckPlayerScriptsJsMessaging @Inject constructor(

override val allowedDomains: List<String> = emptyList()
override val featureName: String = "duckPlayerPage"
override val methods: List<String> = listOf("initialSetup", "openSettings", "openInfo", "setUserValues")
override val methods: List<String> = listOf(
"initialSetup",
"openSettings",
"openInfo",
"setUserValues",
"reportPageException",
"reportInitException",
)
}
}

0 comments on commit 40fc837

Please sign in to comment.