Restrict navigation in browser widget

hh hh at hyperhh.de
Wed Jul 26 10:55:22 EDT 2017


The following works here.

on browserNavigateBegin pUrl
  put the URL of widget "browser" into uri
  put pURL &cr& uri &cr & (uri begins with "http://livecode.com")
end browserNavigateBegin

Possibly your URL conflicts with the standards-compliant URL?

> Tore N. wrote:
> I am currently preparing the coursework for next years classes in programming.
> Working with the browser widget, I am trying to restrict navigation in a a widget
> to a specific domain, but have run into a problem I can not get my head around. I
> use the browserNavigateBegin message to capture the url that the widget tries to
> navigate to. This works fine if I make a direct comparison of the parameter pUrl
> and a specific target url. (ex. pURL = "http://vg.no <http://vg.no/>"). If I try
> to make a comparison of pUrl to the first part of a specific domain, it fails.
> (ex. pUrl begins with “http://vg.no <http://vg.no/>”) I have checked to see if
> “begins with” works outside of the browser widget, and it does. I also find it
> intriguing that I can set the url of the widget, but I can not get it. How do
> others restrict navigation in a browser widget?




More information about the use-livecode mailing list