Search code examples
javascriptdebuggingandroid-browsermobile-webkit

Debugging in Android Webkit: unhelpful exception


I'm debugging a web app on an Android phone running webkit (browser listed as "Webkit 3.1"). I'm using weinre to view the console, where I'm logging debug information.

The log messages from Android webkit are very different than in other browsers -- instead of being the normal output, most read:

[ Exception: TypeError: Result of expression 'Object.getOwnPropertyNames' [undefined] is not a function. ] 

I'm not sure how to interpret this message, or how to proceed debugging.


Solution

  • Just copy the expression in question and try to run it with a valid argument in the console: Object.getOwnPropertyNames(Object). For future reference, compare the useragent to the Webkit version in which getOwnPropertyNames was implemented.