Skip to content

Commit c0a80f1

Browse files
committed
Better hint for error stack trace
DevTools cannot handle local://ChromeXt:num:num correctly
1 parent 9ff031d commit c0a80f1

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ object UserScriptHook : BaseHook() {
4545
val lineNumber = it.args[2] as Int
4646
val sourceId = it.args[3] as String
4747
if (it.args[0] as Int == 0 &&
48-
sourceId == "local://ChromeXt" &&
48+
sourceId == "local://ChromeXt/init" &&
4949
lineNumber == Local.anchorInChromeXt) {
5050
Listener.startAction(it.args[1] as String, proxy.getTab(it.thisObject))
5151
} else {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ object WebViewHook : BaseHook() {
3737
// This should be the way to communicate with the front-end of ChromeXt
3838
val consoleMessage = it.args[0] as ConsoleMessage
3939
if (consoleMessage.messageLevel() == ConsoleMessage.MessageLevel.TIP &&
40-
consoleMessage.sourceId() == "local://ChromeXt" &&
40+
consoleMessage.sourceId() == "local://ChromeXt/init" &&
4141
consoleMessage.lineNumber() == Local.anchorInChromeXt) {
4242
Listener.startAction(consoleMessage.message())
4343
} else {

app/src/main/java/org/matrix/chromext/script/Manager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ object ScriptDbManager {
131131
}
132132
}
133133
if (runScripts) codes.add("ChromeXt.lock(${Local.key});")
134-
codes.add("//# sourceURL=local://ChromeXt")
134+
codes.add("//# sourceURL=local://ChromeXt/init")
135135
webSettings?.javaScriptEnabled = true
136136
Chrome.evaluateJavascript(listOf(codes.joinToString("\n")), null, bypassSandbox, bypassSandbox)
137137
if (runScripts) {

0 commit comments

Comments
 (0)