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...

3
  • You can add a JavascriptInterface and return virtually any value from your DOM. You can also inject any javascript through loadUrl() Commented Jun 8, 2016 at 4: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. Commented Jun 8, 2016 at 4: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. Commented Jun 8, 2016 at 4:48

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.