Highlighted

[WINDOWS10] StageWebView, LocationEvent.CHANGING not fired if link is called in JavaScript.

Engaged ,
May 25, 2019

Copy link to clipboard

Copied

Hello there,

StageWebView (non native) on windows.

If link is called tapping on

<a href="...">link</a>

LocationEvent.CHANGING is called thus can be intercepted with preventDefault();

If a link is called with:

window.location = "...";

The LocationEvent.CHANGING is not fired.

Works well on iOS and Android.

Bug still exists on AIR 32.0.0.129

TOPICS
Development

Views

191

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

[WINDOWS10] StageWebView, LocationEvent.CHANGING not fired if link is called in JavaScript.

Engaged ,
May 25, 2019

Copy link to clipboard

Copied

Hello there,

StageWebView (non native) on windows.

If link is called tapping on

<a href="...">link</a>

LocationEvent.CHANGING is called thus can be intercepted with preventDefault();

If a link is called with:

window.location = "...";

The LocationEvent.CHANGING is not fired.

Works well on iOS and Android.

Bug still exists on AIR 32.0.0.129

TOPICS
Development

Views

192

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 25, 2019 0
Enthusiast ,
May 25, 2019

Copy link to clipboard

Copied

providing some code maybe?

PippoApps  wrote


If a link is called with:

window.location = "...";

The LocationEvent.CHANGING is not fired.

so many things ...

why use JS to change the window.location in the first place?

because without JS and just listening to the LocationEvent it should just work fine
so you decided to use JS, why ?

do you use loadURL() or loadString() ?

is it a local file? do you access it with file:// ? is it a custom scheme?

is there some special characters in the URL?

if it is a local file where do you store it?
what is the JS that change the location?
did you try other things like document.location, document.location.href ?

see

Adobe Flash Platform * Displaying HTML content in mobile apps

the part about loading content from local or remote resource


see

StageWebView differences between platforms | AIR SDK

for slight different behaviour of the stagewebview implementation

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 25, 2019 0
Engaged ,
May 25, 2019

Copy link to clipboard

Copied

Thank you Zwetan.

I will try some of the workarounds you suggest.

I use JavaScript because what happens in WebViews is quite complex, and I need to send several messages to ActionScripts (that you can intercept only with Locationevent.CHANGING).

Other than the architactural choice for which I do have my reasons, thank you for the links I will try to look if there is more info.

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 25, 2019 0
Engaged ,
May 25, 2019

Copy link to clipboard

Copied

PS - No difference if html is embedde din app or on a web server, same behavior.

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 25, 2019 0