How to enable embedded javascript debugger in SWT browser? - javascript

I want to embed a JavaScript debugger in a SWT browser.
I'm using the SWT.MOZILLA flag for creating the browser. Since the JavaScript application I'm loading is complex, I need to have some JS debugger (any is suitable: firebug, venkman).
So, is there any way to embed a JS debugger in a browser widget?
I've heard about firebug-lite, but I don't know how to configure it in SWT. Could you give some working example?

See my answer on Using Firebug Lite in SWT Browser. The code snippet works with XULRunner 10.0.2 and Eclipse 4.2.
Output for XULRunner

http://getfirebug.com/firebuglite
Guess that you should try to add the firebug code to your script tag

Related

how to debug jsp and javascript file in eclipse?

My project containing java files, applets, jsp and javascript file. I am able to debug applet and java files But not able to configure the debug setup for jsp and javascript files in eclipse.
I tried debug using F12 tools throw browser IE10 but those files are not coming under the project.
please mention the steps for configuring the debug setup
Thanks,
Since the Javascript is executed on browser, Eclipse won't be able to debug it, unless it has some way to connect to the browser. You can try using AJAX Toolkit Framework, however, it's best to use internet browser's built-in debugger. You can also have a look at Aptana.
If your javascript files are not appearing in the IE debugger:
Check if the javascript files are included properly.
Try debugger on Chrome or Firefox (or with Firebug extension on
Firefox)
Also, you will not be able to place a debug pointer in JSP file unless it's placed in JAVA scriptlet part of JSP.

Run Firebug Lite from a JavaScript file?

I'm trying to debug an iPad mini and don't have access to a Mac.
I need to log some events during page-load. Is there some way to activate Firebug Lite from the JavaScript file, so that it's available while initiation JavaScript is running?
How to debug Javascript running in a webview on an iPad?
in-a-webview-on-an-ipad
This SO answer covers this a little bit, but I think you want to look further into remote debugging. See this tutorial here:
http://developer.telerik.com/featured/a-concise-guide-to-remote-debugging-on-ios-android-and-windows-phone/

Unable to debug javascript in VS2010 with SP1

I am using Asp.Net MVC project and using jQuery to code JavaScript. Problem is I am not able to debug JavaScript. I searched for this issue and found a few threads. Basically this one:
Visual Studio 2010 script debugger doesn't work for me
And
The breakpoint will not currently be hit. No symbols have been loaded for this document in a Silverlight application
None of these are currently working for me. I tried to launch my application in Chrome and IE9 but my breakpoint just doesn't get hit.
Can you tell me what is the issue?
Use IE9 with the F12 developer tools, FF5/FireBug and Chrome. They all have good javaScript debuggers. It's a good idea to use all of them.

Create Javascript Debugger

I want to create my own javascrip debugger using V8 debugger in eclipse. But i am not getting any document about the V8 debugger or any Source code for v8 debugger. i have my own browser. i want to create one Javascript debugger which debug the .js code remotely. And same debugger i want connet with my own browser. So what can i use for creating debugger in eclipse. can i use v8 debugger as base for my debugger or any other idea i have to use for that.
Thanks for your support
Just out of curiosity - why reinvent the bicycle? FireBug has arguably the best free javascript debugger available

Debug JavaScript in Eclipse

How can I debug JavaScript in Eclipse. I am using Eclipse 3.2.1. Everytime I click on the side it gives the option for adding bookmark but no break point.
Could anyone assist me on this?
In 2015, there are at least six choices for JavaScript debugging in Eclipse:
New since Eclipse 3.7: JavaScript Development Tools debugging support. The incubation part lists CrossFire support. That means, one can use Firefox + Firebug as page viewer without any Java code changes.
New since October 2012: VJET JavaScript IDE
Ajax Tools Framework
Aptana provides JavaScript debugging capabilities.
The commercial MyEclipse IDE also has JavaScript debugging support
From the same stable as MyEclipse, the Webclipse plug-in has the same JavaScript debugging technology.
Adding to the above, here are a couple of videos which focus on "debugging JavaScript using eclipse"
Debugging JavaScript using Eclipse and Chrome Tools
Debugging JavaScript using Eclipse and CrossFire (with FB)
Outdated
The Google Chrome Developer Tools for Java allow debugging using Chrome.
I don't believe Eclipse has a JavaScript debugger - those breakpoints are for Java code (I'm guessing you are editing a JSP file?)
Use Firebug to debug Javascript code, it's an excellent add-on that all web developers should have in their toolbox.
I'm not a 100% sure but I think Aptana let's you do that.
I tried to get aptana running on my ubuntu 10.4. Unfortunately I didn't succeed. Chrome on the other hand, has an eclipse plugin that lets you debug javascript that's running in a chrome instance. Works very well.
YOu'll have to install the eclipse plugin you'll find here:
http://code.google.com/p/chromedevtools/
Set Breakpoints in the javascript sources you edit in eclipse and browser your page in chrome. As soon as a javascript breakpoint is hit, the eclipse debugger halts and lets you step into, step over, browse the variables etc. Very nice!
JavaScript is executed in the browser, which is pretty far removed from Eclipse. Eclipse would have to somehow hook into the browser's JavaScript engine to debug it. Therefore there's no built-in debugging of JavaScript via Eclipse, since JS isn't really its main focus anyways.
However, there are plug-ins which you can install to do JavaScript debugging. I believe the main one is the AJAX Toolkit Framework (ATF). It embeds a Mozilla browser in Eclipse in order to do its debugging, so it won't be able to handle cross-browser complications that typically arise when writing JavaScript, but it will certainly help.
Use the debugging tools supported by the browser. As mentioned above
Firebug for Firefox
Chrome Developer Tools from Chrome
IE Developer for IE.
That way you can detect cross-browser issues. To help reduce the cross-browser issues, use a javascript framework ie jQuery, YUI, moo tools, etc.
Below is a screenshot (javascript-debug.png) of what it looks lime in Firebug.
1) hit 'F12'
2) click the 'Script' tab and 'enable it' (if you are already on your page - hit 'F5' to re-load)
3) next to the 'All' drop down, there will be another dropdown to the right. Select your javascript file from that dropdown.
In the screenshot, I've set a break-point at line 42 by 'left-mouse-click'. This will enable you to break, inspect, watch, etc.
It's possible to debug JavaScript by setting breakpoints in Eclipse using the AJAX Tools Framework.
MyEclipse (eclipse based, subscription required) and Webclipse (an eclipse plug-in, currently free), from my company, Genuitec, have newly engineered (as of 2015) JavaScript debugging built in:
You can debug both generic web applications and Node.js files.
For Node.js there is Nodeclipse 0.2 with some bug fixes for chromedevtools

Categories