<div dir="ltr">Hi,<div><div style>A few weeks ago, on the IRC channel there was a question about Weinre . For those who don't know what Weinre is (definition from Weinre's homepage) :</div><div style><br></div><div style>
<span class="" style="color:rgb(0,136,136);font-style:italic;font-weight:bold;font-family:Menlo,Monaco,Consolas,'Lucida Console','dejavu sans mono',monospace;font-size:19px">weinre</span><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:19px"> is a debugger for web pages, like FireBug (for FireFox) and Web Inspector (for WebKit-based browsers), except it's designed to work </span><b style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:19px">remotely</b><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:19px">, and in particular, to </span><b style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:19px">allow you debug web pages on a mobile device such as a phone</b><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:19px">.</span><br>
</div><div style><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:19px"><br></span></div><div style>So it's extremely useful and totally in the scope of Aerogear (Web/Hybrid) which targets mobile development .</div>
<div style>It's easy to setup :</div><div style><br></div><div style>1. Install the Weinre server , if you have npm : <span style="background-color:rgb(255,255,223);color:rgb(0,0,0)">sudo npm -g install weinre </span></div>
<div style><font color="#000000">2. Start the Weinre server : weinre --httPort 8081</font></div><div style><font color="#000000">3. Instrument your web page to act as a debug target by adding the following :</font></div><div style>
<font color="#000000"><script src="<a href="http://a.b.c:8081/target/target-script-min.js">http://a.b.c:8081/target/target-script-min.js</a>"></script></font></div><div style><font color="#000000"><br>
</font></div><div style><font color="#000000">To make things even easier, I've created a new branch on the kitchensink app where step 3 is not needed anymore[1]. Instead of this you can just activate remote debugging by passing an parameter in the URL : </font></div>
<div style><font color="#000000"><br></font></div><div style><font color="#000000"><a href="http://a.b.c:8080/jboss-as-kitchensink-aerogear-js/index.html?debug=d.e.f:8081">http://a.b.c:8080/jboss-as-kitchensink-aerogear-js/index.html?debug=d.e.f:8081</a></font></div>
<div style><font color="#000000"><br></font></div><div style><font color="#000000">Where d.e.f is the IP of the server where Weinre is running.</font></div><div style><font color="#000000"><br></font></div><div style><font color="#000000">Then you can access the debug page : <a href="http://localhost:8081/client">http://localhost:8081/client</a> </font></div>
<div style><font color="#000000"><br></font></div><div style><font color="#000000">The little tweak I made give more flexibility on how you can integrate your app with Weinre :</font></div><div style><font color="#000000">- No hardcoding in your script.</font></div>
<div style><font color="#000000">- You can easily change the IP of the debug server</font></div><div style><font color="#000000">- The client makes only make requests to the debug servers (and there are a lot of requests :) ) if debugging is activated.</font></div>
<div style><font color="#000000"><br></font></div><div style><font color="#000000">If more people find this useful maybe we could merge it for the next release. comments welcome !</font></div><div style><font color="#000000"><br>
</font></div><div style><font color="#000000">Seb</font></div><div style><font color="#000000"><br></font></div><div style><font color="#000000">[1] </font><a href="http://people.apache.org/~pmuellr/weinre/docs/latest/">http://people.apache.org/~pmuellr/weinre/docs/latest/</a>)</div>
<div style>[2] <a href="https://github.com/sebastienblanc/as-quickstarts/tree/weinre/kitchensink-aerogear-js">https://github.com/sebastienblanc/as-quickstarts/tree/weinre/kitchensink-aerogear-js</a></div></div></div>