Can't display webpage from livecode Mac application
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Can't display webpage from livecode Mac application
Hi, who can help me getting to work a code like this on a Mac. In Windows it works fine. But not on my MacBook. Thanks. Kind regards Johan
on browserOpen
put "http://www......." into sLink
put revBrowserOpen(the windowId of this stack, sLink) into sBrowserID
revBrowserSet sBrowserID, "rect" , the rect of graphic "browsersq"
revBrowserSet sBrowserID, "scrollbars", false
end browserOpen
on mouseUp pMouseButton
browserOpen
end mouseUp
on browserOpen
put "http://www......." into sLink
put revBrowserOpen(the windowId of this stack, sLink) into sBrowserID
revBrowserSet sBrowserID, "rect" , the rect of graphic "browsersq"
revBrowserSet sBrowserID, "scrollbars", false
end browserOpen
on mouseUp pMouseButton
browserOpen
end mouseUp
Re: Can't display webpage from livecode Mac application
I just tried the example in the documentation:
This fails to open a safari window browser on Mac... i have no prior experience with this command, if this s not expected behaviour then a bug report is probably in order?
Code: Select all
local tBrowserId
put revBrowserOpen(the windowId \
of this stack, "http://www.livecode.com" ) into tBrowserId
if tBrowserId is not an integer then
answer "Failed to open browser"
end if
Re: Can't display webpage from livecode Mac application
Without knowing anything and not able to check the problem or the code, first guess is that the url needs to be https:// unless you can instruct the browser instance to disable secure site requirements.
Re: Can't display webpage from livecode Mac application
I can’t check right now but seems unlikely. As far as I can tell from the documentation, this is meant open a new window in Safari and then navigate to the URL, however safari is never even launched - so it doesn’t appear to be a URL problem.
But I will check when I get a chance…
-
- VIP Livecode Opensource Backer
- Posts: 4027
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Can't display webpage from livecode Mac application
Hi Jojo,
I tried your code on a Mac
I tried this after having tried a couple of times to create successfully a browser with slight variations of your code and then your code failed, debugging failed also.
Closing Livecode and reopening it then your code (as above) worked.
What I gather from this is that LC does not like too many browser instances at the same time.
Could you try this in a freshly started LC?
Why don't you use a Browser Widget?
Disclaimer:
I have hardly any experience using a browser in LC.
Kind regards
Bernd
I tried your code on a Mac
Code: Select all
local sBrowserID
on browserOpen
put "https://www.google.com" into sLink
put revBrowserOpen(the windowId of this stack, sLink) into sBrowserID
revBrowserSet sBrowserID, "rect" , the rect of graphic "browsersq"
revBrowserSet sBrowserID, "scrollbars", false
end browserOpen
on mouseUp pMouseButton
browserOpen
end mouseUp
Closing Livecode and reopening it then your code (as above) worked.
What I gather from this is that LC does not like too many browser instances at the same time.
Could you try this in a freshly started LC?
Why don't you use a Browser Widget?
Disclaimer:
I have hardly any experience using a browser in LC.
Kind regards
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 4027
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Can't display webpage from livecode Mac application
@Stam
You have to set the rect of the browser to make it visible.
Kind regards
Bernd
You have to set the rect of the browser to make it visible.
Kind regards
Bernd
Re: Can't display webpage from livecode Mac application
What are the advantages of using revbrowseropen vs the browser widget?
Re: Can't display webpage from livecode Mac application
Thanks Bernd (as always!)... I was a bit mystified until i noticed the sentence quite far down, near the end of the documentation:
That's a blinder.... Perhaps this needs to be given a position of prominence in the documentationDictionary/revBrowserOpen wrote:The default rect of a new browser instance is 0,0,0,0. To change this, set the "rect" property using the revBrowserSet command.
Also it really didn't do what i'd thought it would do based on how the Dictionary is written (namely launch Safari) but as Klaus points out just creates a browser inside the stack much like the browser widget but without the benefit of being able to manipulate the browser object in the IDE (plus it seems to cause a really annoying flicker on scrolling).
I have to echo Klaus' question:
Re: Can't display webpage from livecode Mac application
Thank you all already for your help. Sites with https open fine, I see now too. It is about this "key2publish.../portal2/registration" site.
Unfortunately it will use http for a while. So I will try to find out how I can open it and check out your comments. Kind regards Johan
Unfortunately it will use http for a while. So I will try to find out how I can open it and check out your comments. Kind regards Johan