admin管理员组

文章数量:1401621

For educational purpose, I want to remotely debug an application running on my mobile device that I don't have access to the source code, as long as I understand that is possible with direct injection:

.html

.html?javascript:(function(s){s.src='.js';document.body.appendChild(s)})(document.createElement('script'))

I tried to follow the instructions, I created the bookmaker on my device and everything but I have no clue how to make it work, does any one have any idea how it works?

This page should redirect right away to the correct url, once it does, bookmarket it on your mobile phone, then remove the .html? (including the question mark) part to get the bookmarklet to work.

Alternatively, to inject JS Console, bookmarket this: JS Console and sync to your phone.

For instance, how can I debug remotely this jQueryUI with ???: .html

Thanks!

PS, jsconsole screencast

For educational purpose, I want to remotely debug an application running on my mobile device that I don't have access to the source code, as long as I understand that is possible with http://jsconsole. direct injection:

http://jsconsole./inject.html

http://jsconsole./inject.html?javascript:(function(s){s.src='http://jsconsole./inject.js';document.body.appendChild(s)})(document.createElement('script'))

I tried to follow the instructions, I created the bookmaker on my device and everything but I have no clue how to make it work, does any one have any idea how it works?

This page should redirect right away to the correct url, once it does, bookmarket it on your mobile phone, then remove the http://jsconsole./inject.html? (including the question mark) part to get the bookmarklet to work.

Alternatively, to inject JS Console, bookmarket this: JS Console and sync to your phone.

For instance, how can I debug remotely this jQueryUI with http://jsconsole.???: http://jqueryui./demos/resizable/default.html

Thanks!

PS, jsconsole screencast http://www.youtube./watch?v=Y219Ziuipvc

Share Improve this question edited Apr 20, 2012 at 14:50 lito asked Apr 20, 2012 at 14:21 litolito 3,12511 gold badges45 silver badges71 bronze badges 5
  • Why not use firebug or firebug lite? – Larry Battle Commented Apr 20, 2012 at 14:31
  • Did you click on the bookmark that you made? – scottheckel Commented Apr 20, 2012 at 14:35
  • 1 @LarryBattle: because there is no way to use firebug on a WebKit mobile browser. – lito Commented Apr 20, 2012 at 14:41
  • @Hexxagonal: yes I did, and I got the jsconsole but then how can I remotely debug? – lito Commented Apr 20, 2012 at 14:41
  • Note that, at the moment, the bookmarklet for injection is broken due to a file having gone missing in refactoring: github./remy/jsconsole/issues/75 – Stuart P. Bentley Commented Aug 22, 2016 at 15:26
Add a ment  | 

2 Answers 2

Reset to default 5

Once you've got the jsconsole up and running type the mand:

:listen

to begin remote debugging.

Here's what I did to make this work for me:

  1. Go to the console at JSConsole.Com
  2. Run the mand :listen - this generates a unique key for you with a JS url.
  3. Copy the url it gives you for the JS file, It looks something like: http://jsconsole./remote.js?C180AA15-F9E3-406F-A8F5-F27267DE69C6
  4. Open a new browser window and go to the URL you want to debug
  5. Paste the following into the browser replacing the URL for the one you generated above: javascript:(function(s){s.src='http://jsconsole./remote.js?C180AA15-F9E3-406F-A8F5-F27267DE69C6';document.body.appendChild(s)})(document.createElement('script'));
  6. Go back to the console window and it'll tell you it's connected:

Connection established with http://jqueryui./demos/resizable/default.html Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19

Right click on the bookmark.

Click edit in context menu.

Delete http://jsconsole./inject.html? from it.

Now go to the page you want to analyse and left click on the bookmark. You'll get redirected to http://jsconsole./ and now you can do anything with the page you want.. e.g. you can check the title by typing document.title and pressing enter.

本文标签: javascripthow to inject JS Console in to any page jsconsolecomStack Overflow