Skip to main content
Inspiring
June 27, 2017
Question

air 26 stagewebview - some breaking changes

  • June 27, 2017
  • 5 replies
  • 5923 views

Hello,

I just updated from AIR SDK 24 to 26 as I had some issues with StageWebView on iOS.

But now I am having more issues:

- On desktop (windows), setting StageWebView(true) makes javascript misbehave, like functions not triggering.

- On both iOS and Windows, stage webview does not fire the Complete event anymore (it works fine on Android). So I am unable to know if a page has loaded or not

- Calling a javascript function via loadURL("javascript:functionname();") does not work anymore on iOS and Desktop.

This topic has been closed for replies.

5 replies

Oleg Korchagin
Inspiring
November 30, 2017

Any updates?

Air 28.0.0.120 can load file://...../index.html

But index.html can't load images and css <link href="style.css" rel="stylesheet">.

pravishtis
Adobe Employee
Adobe Employee
February 20, 2018

Hi,

This issue has been fixed. Please give it a try with AIR 29 Beta from Download Adobe AIR 29 Beta - Adobe Labs.

Thanks,

Pravishti | Adobe AIR Engineering

Participant
March 28, 2018

Hello,

Tested on iOS 10.3.3 and iOS 11.2.5 with AIR 29

I was able to load the locally created file (from File.cacheDirectory) into the StageWebView.

(basically I'm using StageWebViewBridge modified a little to avoid all those javascript calls)

However, everything works just fine with the HTML and CSS, but not for JS files included inside the generated HTML file.

Just for your information, I'm also using Away3D in my project, and I'm loading .awd files from the same "cacheDirectory" (differnet folder). No matter if I ask for File or FileReference permissions on startup, .awd files just won't load inside the View3D scene.

Project Setup:

- Robotlegs 1.5.2

- Starling 2.2

- Feathers 3.3.0

- Away3D 4.1.6

Adobe Employee
July 26, 2017

Hi,

Issue is not reproducible at our end please share a sample project with us.

Regards,

Adobe AIR Team

jiec32975056
Participant
July 28, 2017

Hi:

I tried a new method yesterday。

private var webView:StageWebViewBridge = null;

webView.addEventListener(flash.events.Event.COMPLETE,oncomplete);

protected function oncomplete(event:flash.events.Event):void

{

//add delay 2seconds, do work.

mytime.reset();

mytime.delay=2000;

mytime.repeatCount = 1;

mytime.start();

}

protected function ontimecomplete(event:TimerEvent):void

{

var strpath1:String = "app:/html/test.mp4";

var path1:String = new File(new File(strpath1).nativePath).url;

var path:String = "[{\"url\":\""path1"\",\"head\":\"\"}]";

webView.call("fnCalledFromAs3",null,path);

}

calling a javascript function via loadURL("javascript:functionname();") do work。

But have a question.

My webview have video

H5 video. is playing. app:/html/test.mp4; do work。

H5 Video。 playing "file:///var/mobile/Containers/Data/Application/512EC30D-B01A-47CB-88E2-912F6CED3102/Library/Application Support/starq.game.xbb/Local Store/mov/qb707.mp4" ; do not work.

I used the test

var f:File =new File("file:///var/mobile/Containers/Data/Application/512EC30D-B01A-47CB-88E2-912F6CED3102/Library/Application Support/starq.game.xbb/Local Store/mov/qb707.mp4");

f.exists is true.

If you have experience in this field, please let me know,thanks.

Regards.

Richard Chen.

Adobe Employee
August 2, 2017

Hi Richard,

We use file:// in a different way. The above mentioned way will not work. Please go through the forum issue and you will find the different solutions. Please revert back if this doesn't help you.

StageWebView for Local HTML file

Regards,

Adobe AIR Team

jiec32975056
Participant
July 25, 2017

   Using AIR 26 build 119.  or. build 118.   It started to happen on iOS.

   I will

          webview.loadURL("http://.../media/media.html");

         calling a javascript function via loadURL("javascript:functionname();") do work。

  I will

  var strpath:String = "app:/html/media.html";

  var path:String = new File(new File(strpath).nativePath).url;

  webView.loadURL(path);

    calling a javascript function via loadURL("javascript:functionname();") do not work。

Lars Laborious
Legend
June 28, 2017

Hi, I don't know, but this might be related to AIR 26 using WKWebView (instead of UIWebView) behind the scene, for StageWebView. You can read about executing JavaScript here: https://developer.apple.com/documentation/webkit/wkwebview

Inspiring
June 27, 2017

It's strange because I use stageebview intensively (with bi-directionnal communication) and for me the complete event is fired on windows, ios and android. Javascript call is working as well on the three platforms.

I didn't try StageWebView(true) on desktop tho.

Inspiring
June 28, 2017

It started to happen with AIR26 - AIR 24-25 work fine.

I guessed it was related to WKWebView as on Android it is working fine.

I am not sure what changed in the desktop implementation that also broke it.