how to get WebView console

471 views
Skip to first unread message

PacMan Programador

unread,
Jul 8, 2019, 3:32:51 PM7/8/19
to DroidScript
Hello, I would like to know if you can get the console from a web comes, I know there is a function called SetOnConsole but only performs an action but it does not give me what the console wrote

Symbroson

unread,
Jul 8, 2019, 3:48:12 PM7/8/19
to DroidScript
There is no web.SetOnDebug function if you wanted smth like that. You may request that feature in the TellUsWhatUWant thread

But you can use following two functions in your html code:

app.SetOnDebug() to retreive all console output
app.Execute()  to execute a command (console log) in your main app

you need to include app.js in your html file for that (like in the deafault DS html app)

note that this may be a security issue if not properly done, because if you want the user to edit the code he may be able to access the abb object and break things in your app.

If you don't want to use app functions search for js console hooking like described here: https://stackoverflow.com/questions/19846078/how-to-read-from-chromes-console-in-javascript
you have to do that for each function - console.log error warn debug etc.
Reply all
Reply to author
Forward
0 new messages