0

Is it possible to type and evaluate Javascript solely on an Android browser (any browser with any plugin/configuration, doesn't matter) w/o involving a desktop (Remote or USB debugging)?

I need that to obtain the value of a dynamic login token of a website on an Android device. So I need to be able to evaluate and output:

 console.log(sb233.sb)
 alert.log(sb233.sb)

In which case "sb233" is a variable accessible on the console of a desktop browser.

Asking coz I don't really want to go as far as to write a plugin for this purpose only...

Bryan Huang
  • 5,247
  • 2
  • 15
  • 20
  • You can add a `JavascriptInterface` and return virtually any value from your DOM. You can also inject any javascript through `loadUrl()` – 323go Jun 08 '16 at 04:43
  • i don't think he's talking about android development, i think he's asking about mobile-browers in general, to which i would say, typing javascript into a phone is asinine. just change the user agent in your desktop browser to get the mobile version of whatever it is youre trying to messwith. – I wrestled a bear once. Jun 08 '16 at 04:46
  • however, it would be relatively easy to build a mobile browesr that takes junk from a text box and executes it in a webview over another website. – I wrestled a bear once. Jun 08 '16 at 04:48

1 Answers1

1

As seen from here:

How can I debug javascript on Android?

Pierre-Antoine LaFayette wrote:

You can also navigate to about:debug in the URL bar to activate the debug menu and the JavaScript error console with recent Android devices. You should see SHOW JAVASCRIPT CONSOLE at the top of the Browser.

Currently in Android 4.0.3 (Ice Cream Sandwich), the logcat outputs to the browser channel. So you can filter using adb logcat browser:* *:S.

Community
  • 1
  • 1
Sriram
  • 359
  • 1
  • 13