Skip to main content
Inspiring
May 15, 2012
Answered

HTML set as string open in device browser, not in internal webkit

  • May 15, 2012
  • 2 replies
  • 889 views

I have the stupidest AIR bug here on iOS. HTML set as string to StageWebView now open in the device browser with URL like this http://adobe.13323422.apollo.air/

It only happens on the device (iPhone's or iPad's), not in the simulator. Anyone?

This topic has been closed for replies.
Correct answer Jens Chr

Answering my own question in case others stumble upon the same problem. On my StageWebView I had a listener:

htmlContainer.addEventListener(LocationChangeEvent.LOCATION_CHANGING, handleExternalUrl );

My problem was twofold. Firstly, I had to check that the .location property on the event-object passed to my handleExternalUrl-handler did not contain the string "apollo.air". No url should ever contain a TLD called .air so this test will never fail :-)

Secondly, I was calling .preventDefault() and this prevented other things to happen as it should in the app. Now works perfectly. It's still odd that this only occured on the iOS devices and not in the iOS simulator or any other devices.

2 replies

Jens ChrAuthorCorrect answer
Inspiring
May 16, 2012

Answering my own question in case others stumble upon the same problem. On my StageWebView I had a listener:

htmlContainer.addEventListener(LocationChangeEvent.LOCATION_CHANGING, handleExternalUrl );

My problem was twofold. Firstly, I had to check that the .location property on the event-object passed to my handleExternalUrl-handler did not contain the string "apollo.air". No url should ever contain a TLD called .air so this test will never fail :-)

Secondly, I was calling .preventDefault() and this prevented other things to happen as it should in the app. Now works perfectly. It's still odd that this only occured on the iOS devices and not in the iOS simulator or any other devices.

sinious
Legend
December 10, 2012

I also have this issue. The documentation on LOCATION_CHANGING clearly states:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/StageWebView.html#event:locationChanging

A locationChanging event is not dispatched when you change the location with the following methods:

  • historyBack()
  • historyForward()
  • loadString()
  • loadURL()
  • reload()

That isn't true. I'm also using loadString() and I get a new Safari with the same "adobe.[numbers].apollo.air/ " as a location. This doesn't seem to be an issue with OS5.x but once I updated to OS6 this now happens. This happens on AIR3.4 and AIR3.5.