Search code examples
node.jsweinre

Weinre JS API onload/ready event


I'm using Weinre to debug an iPad App and was looking for a JS callback from Weinre that signals when Weinre has finished loading and e.g. it's safe to use its console object in my code.

I looked through the docs and the target-script.js that hooks Weinre into my page but couldn't find anything.

Any help would be appreciated.


Solution

  • I think by "safe to use the console" object, you mean, when will writing to the console object start writing to the remote console window. If so, that's a tough proposition, as your app might NEVER connect to a client debugger. Or the client debugger might connect, then disconnect, then connect, ... There would really need to be two events - weinreConnected and weinreDisconnected, or some such.

    I didn't want to have to add new events to the system, but if there's a lot of interest, we can probably make it happen. Feel free to open a Jira issue for a new feature.