webbrowser: support open-url on "url-like" strings.
parent
03a8290da9
commit
ab7890911c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue