Highlighted

WebStageView - route JavaScript console.log to trace()

Engaged ,
May 07, 2019

Copy link to clipboard

Copied

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

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.

TOPICS
Development

Views

155

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

WebStageView - route JavaScript console.log to trace()

Engaged ,
May 07, 2019

Copy link to clipboard

Copied

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

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.

TOPICS
Development

Views

156

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 07, 2019 0
Engaged ,
May 07, 2019

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 07, 2019 0