1 ! Copyright (C) 2011 John Benediktsson
2 ! See http://factorcode.org/license.txt for BSD license
3 USING: accessors command-line io.pathnames kernel namespaces
4 sequences strings system ui.operations urls vocabs ;
7 HOOK: open-item os ( item -- )
9 "webbrowser." os name>> append require
14 PREDICATE: url-string < string >url protocol>> >boolean ;
16 [ pathname? ] \ open-item H{ } define-operation
17 [ [ url? ] [ url-string? ] bi or ] \ open-url H{ } define-operation
19 : webbrowser-main ( -- )
20 command-line get [ open-url ] each ;