Skip to content

Commit

Permalink
Fix finding onConsoleMessage class
Browse files Browse the repository at this point in the history
Fix support for the Via browser
  • Loading branch information
JingMatrix committed Mar 12, 2024
1 parent 7336de1 commit 72b8462
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/src/main/java/org/matrix/chromext/hook/WebView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ object WebViewHook : BaseHook() {

override fun init() {

findMethod(ChromeClient!!, true) { name == "onConsoleMessage" }
findMethod(ChromeClient!!, true) { name == "onConsoleMessage" && parameterCount == 1 }
// public boolean onConsoleMessage (ConsoleMessage consoleMessage)
.hookAfter {
// Don't use ConsoleMessage to specify this method since Mi Browser uses its own
// implementation
// This should be the way to communicate with the front-end of ChromeXt
val chromeClient = it.thisObject
val consoleMessage = it.args[0]
Expand Down

0 comments on commit 72b8462

Please sign in to comment.