Skip to content

Commit 72b8462

Browse files
committed
Fix finding onConsoleMessage class
Fix support for the Via browser
1 parent 7336de1 commit 72b8462

File tree

1 file changed

+3
-1
lines changed
  • app/src/main/java/org/matrix/chromext/hook

1 file changed

+3
-1
lines changed

app/src/main/java/org/matrix/chromext/hook/WebView.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ object WebViewHook : BaseHook() {
3434

3535
override fun init() {
3636

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

0 commit comments

Comments
 (0)