Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Weinre JS API onload/ready event

Tags:

node.js

weinre

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.

like image 314
flu Avatar asked Feb 12 '13 11:02

flu


1 Answers

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.

like image 104
Patrick Mueller Avatar answered Oct 23 '22 15:10

Patrick Mueller