Page 1 of 1

Browser not Working Consistently

Posted: Fri Jun 13, 2014 3:25 pm
by wimpykid1570
Hi,

I don't know why the browser does not work consistently in the following codes. When I navigate to some links after a search on google.com, sometimes the browser becomes invisible. Please help.

(the codes should be in a card script section; the card needs an Image control named Image1)

Code: Select all

local tBrowserID

on openCard
   browserOn
end openCard

on closeCard
   browserOff
end closeCard

on browserOn
   put revBrowserOpen((the windowId of this stack), "http://google.com") into tBrowserID
   revBrowserSet tBrowserID, "showborder", true
   revBrowserSet tBrowserID, "rect", the rect of image "Image1"
end browserOn

on browserBeforeNavigate tBrowserID, pURL
   global browserCancel
   
   if "google.com" is not in pURL then
      answer warning "Cannot navigate away from google.com."
      put true into browserCancel
   end if
end browserBeforeNavigate

on browserOff
   if tBrowserID is an integer then
      revBrowserClose tBrowserID
   end if
   
   put empty into tBrowserID
end browserOff

Re: Browser not Working Consistently

Posted: Fri Jun 13, 2014 3:35 pm
by dunbarx
Hi.

Everything seems to work for me. I navigated around quite a bit. I had to turn off your "browserBeforeNavigate" handler, of course. I assume this is not the issue.

Craig Newman