4
votes

Is there any standard way of debugging Javascript on a webpage that's being accessed from a htmlLoader component inside of an Adobe Air application?

I have a web app built using Javascript that works perfectly within the browser. One of the main elements of its user interface is that when you right click on an image, a context menu appears specific to that image.

I'm trying to embed access to this web app within an Adobe Air application. To this end, I've added an htmlLoader that accesses the URL and displays it in the Air application. It works perfectly - except that, after navigating away from the web app's landing page, the context menus no longer display when an image is right-clicked.

I'm thinking this must have something to do with the Javascript when run in Adobe Air (all other aspects of the web app continue to work), but it's hard to go about figuring out what's wrong when the Javascript works perfectly in IE/Chrome/Etc but not inside of Air. I'm very doubtful anything like Firebug exists for Flash Builder/Adobe Air, but it seemed worth asking.

2
does it support calls to console methods? I think it does: help.adobe.com/en_US/AIR/1.5/devappshtml/… - akonsu
Have you tried handling the uncaughtScriptException event to see if there are any exceptions being thrown? - merv
@merv - I did, no uncaught exceptions are being thrown. - Eric G

2 Answers

3
votes

There is AIR Introspector. It's a script that you add to the app (remove during production) that acts like Firebug Lite. It has a console and HTML structure viewer.

And I think you can also use Firebug Lite as well.

1
votes

I know this thread is old, but it is still accessed from google so I'll list this as an alternate answer:

window.onerror = function(msg, url, line) {
   // You can view the information in an alert to see things working
   // like so:
   alert("Error: " + msg + "\nurl: " + url + "\nline #: " + line);

   // TODO: Report this error via ajax so you can keep track
   //       of what pages have JS issues

   var suppressErrorAlert = true;
   // If you return true, then error alerts (like in older versions of 
   // Internet Explorer) will be suppressed.
   return suppressErrorAlert;
};

Credit goes to another SO thread that I've lost track of I'm afraid.