Page 1 of 1

mobileControlGet browserid,"url" crashes... ???

Posted: Mon Jun 08, 2015 8:04 pm
by jihem
Hi,
My app crashes when I try to use mobileControlGet (to get the current URL in the browser).
See the following stack (press GO then URL).
Regards,
jihem

Re: mobileControlGet browserid,"url" crashes... ???

Posted: Tue Jun 09, 2015 1:28 pm
by MaxV
Here are my notes:
  • Please don't use local variables, but custom properties.
  • Why do you think that sBrowserID could not be an integer?
  • Instead of lock screen I'd put all in PreOpenCard message.

Re: mobileControlGet browserid,"url" crashes... ???

Posted: Tue Jun 09, 2015 7:07 pm
by jihem
Thanks for the answer.

> Please don't use local variables, but custom properties.
sBrowserID isn't a local but a script local.

> Why do you think that sBrowserID could not be an integer?
When the browser can't be created it isn't an integer.

> Instead of lock screen I'd put all in PreOpenCard message.
I have updated the stack as you described with the same result :(
mobileControlGet fails and the app crashes.

Re: mobileControlGet browserid,"url" crashes... ???

Posted: Tue Jun 09, 2015 7:36 pm
by jacque
A script local is appropriate (and recommended) for this type of use, so you've done it correctly. Custom properties are useful for values that need to persist across launches, but they can cause problems if the values are intended to be temporary.

I see nothing wrong with your script or its placement in the message path. I also don't see any reason to move it to a preOpenCard, since the user needs to interact with the Go button before anything happens anyway. I suspect the issue is with the URL itself, since it doesn't really have a source on either the web or on disk; it is entirely virtual. That's just a guess, but everything else in the script is pretty standard stuff.

You may have to check the actual content of the browser text rather than the URL to determine what is being displayed. Try it with a "real" URL, like google.com, and see if you still see the same problem.

Re: mobileControlGet browserid,"url" crashes... ???

Posted: Tue Jun 09, 2015 9:16 pm
by jihem
Thanks. I tried.

I have made the following change in the first version of the stack (on browserStart) :

mobileControlSet sBrowserID,"url","http://www.google.fr"
--mobileControlDo sBrowserID, "load", "", getHTML()

with the same result :-(

Re: mobileControlGet browserid,"url" crashes... ???

Posted: Fri Jun 12, 2015 1:24 pm
by MaxV
I think it's a bug, I tried even loading a normal web page (http://www.google.com) a retrieving the information of the url cause me a crash.
The problem is in:

Code: Select all

mobilecontrolGet( sID, "URL")
I posted the bug here in: http://quality.runrev.com/show_bug.cgi?id=15494

Re: mobileControlGet browserid,"url" crashes... ???

Posted: Fri Jun 12, 2015 4:44 pm
by jacque
They've confirmed it already. Good work, I'm glad you submitted the report.

Re: mobileControlGet browserid,"url" crashes... ???

Posted: Wed Jun 17, 2015 9:59 pm
by seanmiller
Howdy,

put mobileControlGet ("lfBrowser", "URL") into tRedirect

also causes iOS to crash...

I've gotten it to crash on an iPad 2 (running iOS 8.2) and on the iOS simulator (device: iPhone 5s).

Sean

Re: mobileControlGet browserid,"url" crashes... ???

Posted: Wed Jun 17, 2015 10:11 pm
by seanmiller
As we wait, is there some other way to access the URL on a mobile browser?