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

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jihem
Posts: 53
Joined: Sun Jul 28, 2013 3:21 pm

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

Post 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
Attachments
mobileBrowserCallBack.zip
(2.14 KiB) Downloaded 813 times
MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

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

Post 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.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
jihem
Posts: 53
Joined: Sun Jul 28, 2013 3:21 pm

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

Post 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.
Attachments
mobileBrowserCallBack.zip
(2.17 KiB) Downloaded 798 times
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

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

Post 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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
jihem
Posts: 53
Joined: Sun Jul 28, 2013 3:21 pm

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

Post 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 :-(
MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

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

Post 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
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

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

Post by jacque »

They've confirmed it already. Good work, I'm glad you submitted the report.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
seanmiller
Posts: 50
Joined: Mon Mar 03, 2014 1:17 am

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

Post 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
seanmiller
Posts: 50
Joined: Mon Mar 03, 2014 1:17 am

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

Post by seanmiller »

As we wait, is there some other way to access the URL on a mobile browser?
Post Reply