Browser not Working Consistently

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
wimpykid1570
Posts: 10
Joined: Thu May 01, 2014 2:31 pm

Browser not Working Consistently

Post by wimpykid1570 » Fri Jun 13, 2014 3:25 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9648
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Browser not Working Consistently

Post by dunbarx » Fri Jun 13, 2014 3:35 pm

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

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”