Quasi Student Secure Web Browser?
johnpatten at me.com
Thu Mar 30 12:10:10 EDT 2017
Never mind… Figured out where all commands that go with the new browser widget were located (release notes). I was looking in the dictionary and never saw them until I saw another post on the list.
on browserDocumentLoadBegin pURL
put the itemDel into tOrgItemDel
set the itemDel to "/"
if item 3 of pURL is not "www.myopenmath.com" then
launch url "https://www.myopenmath.com" in widget "OpenMathBrowser"
answer "Sorry that link is not accessible at this time."
If anybody else is looking for those browser widget commands they can be found in the release notes here:
> On Mar 29, 2017, at 6:32 PM, JOHN PATTEN via use-livecode <use-livecode at lists.runrev.com> wrote:
> Hi All,
> I’m attempting to create a simple secure web browser iOS app for some teachers. I want to prevent any links within an approved site (i.e. “www.approvedsite.com") that link out to others sites from launching. For example, if the "www.approvedsite.com" has a link out to Youtube.com, I want to detect that it is outside the target site and prevent it from loading in the browser object. If the link is within the approved site, i.e. "www.approvedsite.com/anotherpage.html,” I want to allow that page to load in the browser object.
> At first I thought i would use a widget, but then did not see any command that would get the url. So, I switched gears and went with the mobileControlCreate browser strategy. I thought I could use the browserStartedLoading command, but I’m not quite sure how to go about it.
> I am not sure how to capture the link url when the user clicks/taps on the link in the browser, and then check it against acceptable urls?
> I had this is the card script:
> on browserStartedLoading pUrl
> put pUrl into tUrlLoading
> wait 50
> answer tUrlLoading
> set the itemdel to "/"
> answer item 2 of tUrlLoading
> if item 2 of tUrlLoading is not "www.myopenmath.com" then
> answer “You can not access this site."
> end if
> end browserStartedLoading
> Is there a better way to go about accomplishing this in LiveCode?
> Thank you!
> John Patten
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode