...
original commit: ad623303019b1c98714ab530a17a85e8ebc33821
This commit is contained in:
parent
26fcef0c0c
commit
21e3121848
19
collects/net/open-url.ss
Normal file
19
collects/net/open-url.ss
Normal file
|
@ -0,0 +1,19 @@
|
|||
(module open-url mzscheme
|
||||
(provide open-url)
|
||||
|
||||
(define (open-url str)
|
||||
(case (system-type)
|
||||
[(macos)
|
||||
(send-event "MACS" "GURL" "GURL" str)]
|
||||
[(unix)
|
||||
(define netscape-path (find-executable-path "netscape" #f))
|
||||
|
||||
(unless netscape-path
|
||||
(error 'open-url "Couldn't find Netscape."))
|
||||
|
||||
(or (system* netscape-path "-remote" (format "openURL(~a)" url))
|
||||
(let-values ([(out in id err status) (apply values (process* netscape-path url))])
|
||||
(close-output-port in)
|
||||
(close-input-port out)
|
||||
(close-input-port err)))]
|
||||
[else (error 'open-url "don't know how to open url on platform: ~s" (system-type))])))
|
Loading…
Reference in New Issue
Block a user