diff --git a/basis/webbrowser/webbrowser.factor b/basis/webbrowser/webbrowser.factor index ba586e4fe8..1f76f2e224 100644 --- a/basis/webbrowser/webbrowser.factor +++ b/basis/webbrowser/webbrowser.factor @@ -1,7 +1,8 @@ ! Copyright (C) 2011 John Benediktsson ! See http://factorcode.org/license.txt for BSD license -USING: combinators present system ui.operations urls vocabs ; +USING: combinators combinators.short-circuit present sequences strings system +ui.operations urls vocabs ; IN: webbrowser @@ -17,3 +18,8 @@ HOOK: open-file os ( path -- ) >url present open-file ; [ url? ] \ open-url H{ } define-operation + +PREDICATE: url-like < string + { [ "http://" head? ] [ "https://" head? ] } 1|| ; + +[ url-like? ] \ open-url H{ } define-operation