mobileControlGet browserid,"url" crashes... ???
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
mobileControlGet browserid,"url" crashes... ???
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
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 191 times
Re: mobileControlGet browserid,"url" crashes... ???
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
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Re: mobileControlGet browserid,"url" crashes... ???
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.
> 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 206 times
-
- VIP Livecode Opensource Backer
- Posts: 7228
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: mobileControlGet browserid,"url" crashes... ???
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.
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
HyperActive Software | http://www.hyperactivesw.com
Re: mobileControlGet browserid,"url" crashes... ???
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
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... ???
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:
I posted the bug here in: http://quality.runrev.com/show_bug.cgi?id=15494
The problem is in:
Code: Select all
mobilecontrolGet( sID, "URL")
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
- VIP Livecode Opensource Backer
- Posts: 7228
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: mobileControlGet browserid,"url" crashes... ???
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
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 50
- Joined: Mon Mar 03, 2014 1:17 am
Re: mobileControlGet browserid,"url" crashes... ???
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
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
-
- Posts: 50
- Joined: Mon Mar 03, 2014 1:17 am
Re: mobileControlGet browserid,"url" crashes... ???
As we wait, is there some other way to access the URL on a mobile browser?