Skip to main content
Inspiring
May 7, 2019 9:23 PM UTC
Answered

WebStageView - route JavaScript console.log to trace()

Hello there,

I am deploying an AIR app with a WebStageView containing some maps.

So far, in order to test JavaScript I need access to logging. window.console.log is not available inside AIR WebStageview.

Any hint how to route console.log to AS trace output?

cheers

This topic is closed to new replies. Start a new post to keep the conversation going.
PippoAppsCorrect answer
Inspiring
May 7, 2019 9:29 PM UTC

I managed with this JavaScript:

if (!window.console) {

   window.console = {

   log:function(s) {

   window.location = "trace:" + s;

  }

  }

}

And intercepting location change in ActionScript, if "trace:" is at the beginning, just route to trace();

In this fashion I can debug both in AIR and in browser.

1 reply

PippoAppsAuthorCorrect answer
Inspiring
May 7, 2019 9:29 PM UTC

I managed with this JavaScript:

if (!window.console) {

   window.console = {

   log:function(s) {

   window.location = "trace:" + s;

  }

  }

}

And intercepting location change in ActionScript, if "trace:" is at the beginning, just route to trace();

In this fashion I can debug both in AIR and in browser.

Translate