• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

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

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

315

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

Votes

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
community guidelines
Engaged ,
May 25, 2019 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.

Votes

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

Copy link to clipboard

Copied

LATEST

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

Votes

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
community guidelines