Anyone A Guru With RevBrowser ?

Scott Rossi scott at tactilemedia.com
Sun Jul 10 06:43:42 EDT 2011


Apologies for the length of the following...

A client of mine has asked if I could create a stack that can deliver a
Web-based app as a "local" application.  The result will not be truly local
because the app will not run without a Web connection, but regardless, I've
starting build a stack with RevBrowser and have run into some issues, so I'm
wondering if someone might suggest a strategy for accomplishing this.

Issue number 1 is the loading of pages: is there anyway to freeze or lock
the RevBrowser display until downloading of new page content has completed?
The site can be slow to respond, so my thought was to pop up a spinning
progress indicator over a snapshot of the current page so the user knows to
wait.

I've tried grabbing a snapshot of the current page using revBrowserSnapshot,
but this seems to be failing and producing "interlaced" looking results in
the destination image, almost as if the size of the capture doesn't match
the size of the image.  I've set the destination image to be the same size
as the browser rect, even used revBrowserGet to confirm the capture size,
but no go.  So I gave up on revBrowserSnapshot and am grabbing a capture
from the globalRect of the browser, which works, but of course, will be
problematic if the window is ever overlapped by any other windows.

Issue number 2 is "browserBeforeNavigate" which is seemingly unreliable.
The Web site has a logout link, and I am trying to detect clicks on this
using browserBeforeNavigate, so I can kill the browser and send the user to
the first card of the stack if they log out.  Apparently, RevBrowser detects
the link click (tested), but LiveCode stays on the same card and shuts down
the browser at random intervals, sometimes immediately, and other times only
after many seconds (up to 60!).  I'm using this routine:

on browserBeforeNavigate pID,pURL
   if "logout" is in pURL then
      exitBrowser
      wait 250 millisecs with messages
      go cd 1
      exit browserBeforeNavigate
   end if
   pass browserBeforeNavigate
end browserBeforeNavigate


command exitBrowser
   put revBrowserInstances() into theList
   repeat for each item theInstance in theList
      revBrowserClose theInstance
   end repeat
end exitBrowser

I don't understand why this doesn't kill the browser immediately every time.
If I call exitBrowser from a LiveCode button, the script works as expected
reliably.

Thanks for any help/insight.

Regards,

Scott Rossi
Creative Director
Tactile Media, UX Design






More information about the use-livecode mailing list