well, sometimes it takes some time until I "get" it

But once I got it, he he he!

Best
Klaus
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
What is sBrowserId?Klaus wrote:HI Esso,
well, sometimes it takes some time until I "get" it
But once I got it, he he he!![]()
Best
Klaus
sorry is this is obvious but I'm not that good with livecode. I'm more of the web-development typeget revBrowserExecuteScript(sBrowserId, "alert('This is a debugging message');"
get revBrowserExecuteScript(sBrowserId, the text of field "JavaScript" of me)
Code: Select all
...
## Make this variable LOCAL or GLOBAL, depending on where you put all your revBrwoser..." scripts:
global sBrowserID
## 1. You need to supply a window ID, where the browser instance will "stick" to:
put the windowid of this stack into tWID
## 2. Open instance and store its ID for later use!
put revBrowserOpen(tWID,"http://www.server.com/page.html") into sBrowserID
## 3. Check for possible errors, ID MUST be an integer on success:
if sBrowserID is not an integer then
answer "Problems openeing browser:" && sBrowserID
exit to top
end if
## 4.
## Now you need to set some properties of the browser to position the window and SHOW it:
## I ususally use a HIDDEN graphic as a placeholder for the RECT of my browser
put the rect of grc "the hidden placeholder for the browser" into tRect
revBrowserSet sBrowserID, "rect", tRect
revBrowserSet sBrowserID, "visible", TRUE
### etc. check all "revBrowser..." commands and functions in the dictionary.
...
I made a feature request, but its a really simple one that should be quite easy to implement but im afraid that it might get overlooked. Klaus, can you add the ability to use browserDocumentComplete on mobile? It works great on desktops but its not available on mobile.Klaus wrote:Hi Esso,
when you open a (new instance of the) browser control, which is in fact an OVERLAY on top of your stack,
you will get an ID, that you can later use to manage that namely browser instance:
That are the basic commands to open a browserinstance on top of the current card.Code: Select all
... ## Make this variable LOCAL or GLOBAL, depending on where you put all your revBrwoser..." scripts: global sBrowserID ## 1. You need to supply a window ID, where the browser instance will "stick" to: put the windowid of this stack into tWID ## 2. Open instance and store its ID for later use! put revBrowserOpen(tWID,"http://www.server.com/page.html") into sBrowserID ## 3. Check for possible errors, ID MUST be an integer on success: if sBrowserID is not an integer then answer "Problems openeing browser:" && sBrowserID exit to top end if ## 4. ## Now you need to set some properties of the browser to position the window and SHOW it: ## I ususally use a HIDDEN graphic as a placeholder for the RECT of my browser put the rect of grc "the hidden placeholder for the browser" into tRect revBrowserSet sBrowserID, "rect", tRect revBrowserSet sBrowserID, "visible", TRUE ### etc. check all "revBrowser..." commands and functions in the dictionary. ...
And DONT forget to add a button somewhere to close the browser!
...
revBrowserClose sBrowserID
...
Best
Klaus
Have you looked at browserFinishedLoading?EssoAir wrote: I made a feature request, but its a really simple one that should be quite easy to implement but im afraid that it might get overlooked. Klaus, can you add the ability to use browserDocumentComplete on mobile? It works great on desktops but its not available on mobile.
THANK YOU! I completely missed thatjacque wrote:Have you looked at browserFinishedLoading?EssoAir wrote: I made a feature request, but its a really simple one that should be quite easy to implement but im afraid that it might get overlooked. Klaus, can you add the ability to use browserDocumentComplete on mobile? It works great on desktops but its not available on mobile.
I wish I could! It may surprise you, but I am just a user of Livecode and not employed at or related to RunRev in any way.EssoAir wrote:Klaus, can you add the ability to use browserDocumentComplete on mobile?
Well since you're good with livecode, can yo help me figure out how to use " mobileControlCreate 'browser' " on a desktop?Klaus wrote:Hi Esso,
I wish I could! It may surprise you, but I am just a user of Livecode and not employed at or related to RunRev in any way.EssoAir wrote:Klaus, can you add the ability to use browserDocumentComplete on mobile?![]()
Best
Klaus
do I have to make different .livecode files for desktop and mobile?Klaus wrote:Hi Esso,
see my script above, does exactly what you want!![]()
"revBrowser" is the "desktop equivalent" for -> mobilecontrolcreate "browser"...
Best
Klaus
not neccessarily!EssoAir wrote:do I have to make different .livecode files for desktop and mobile?
Code: Select all
on opencard
## or whenever
## We are on iOS or Android
if the environment = "mobile" then
mobilecontrolcreate "browser"...
## More mobile stuff...
else
## Desktop:
put revBrowseropen(...)
## More desktop stuff...
end if
end opencard
Wow lots of code! Ill take a closer look when i get home. I cant run LiveCode on my iPad so i cant do it at school :/Klaus wrote:HI Ess,.
not neccessarily!EssoAir wrote:do I have to make different .livecode files for desktop and mobile?
You can check "the environment" and act accordingly, something like this:You get the pictureCode: Select all
on opencard ## or whenever ## We are on iOS or Android if the environment = "mobile" then mobilecontrolcreate "browser"... ## More mobile stuff... else ## Desktop: put revBrowseropen(...) ## More desktop stuff... end if end opencard
![]()
And maybe take a look at this stack:
http://livecodeshare.runrev.com/stack/7 ... er-Sampler
Best
Klaus