AndroidBrowser

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bohmgyorgy1990
Posts: 23
Joined: Wed Feb 19, 2014 2:33 am

AndroidBrowser

Post by bohmgyorgy1990 » Tue Mar 11, 2014 1:39 pm

Hy!

I have a browser in my android app. I would like to do that if the user click a button/link/anything in this browser and if this link is navigate him to the other page ( example: facebook -> anything other page what doesnt have the "facebook" string in own domain), he get a pop up window and he can choose his own mobile browsers to open it ( chrome, opera, etc ).

Kind regards,

bgy

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: AndroidBrowser

Post by Simon » Thu Mar 13, 2014 4:35 am

Hi bohmgyorgy1990,
This is working

Code: Select all

global gURL
on browserStartedLoading pUrl
   if "facebook" is not in pUrl then --check
      answer "going off site" 
       mobileControlSet sBrowserId, "url", gURL --return to last facebook page
   end if
   put true into gCount
   put "Started loading:" && pUrl into field "Status"
end browserStartedLoading

on browserFinishedLoading pUrl
   put "Finished loading:" && pUrl into field "Status"
   put pUrl into field "Url"
    put pUrl into gURL --load the global
end browserFinishedLoading
Adding the global gURL means that your opening url must have "facebook" in it.
This locks you app to facebook only sites.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

bohmgyorgy1990
Posts: 23
Joined: Wed Feb 19, 2014 2:33 am

Re: AndroidBrowser

Post by bohmgyorgy1990 » Thu Mar 20, 2014 4:44 pm

it is actually work for me, thanks for it.

Post Reply