added opera as first choice under unix
original commit: f2b1feff4945d973fb079af7d306edd4f1f0d9ba
This commit is contained in:
parent
576769bc3e
commit
f572bc2262
|
@ -9,13 +9,24 @@
|
||||||
[(macos macosx)
|
[(macos macosx)
|
||||||
(send-event "MACS" "GURL" "GURL" str)] ;; actually, I think GURL means something slightly different...
|
(send-event "MACS" "GURL" "GURL" str)] ;; actually, I think GURL means something slightly different...
|
||||||
[(unix)
|
[(unix)
|
||||||
(let ([netscape-path (find-executable-path "netscape" #f)])
|
(cond
|
||||||
(unless netscape-path
|
[(find-executable-path "opera" #f)
|
||||||
(error 'open-url "Couldn't find Netscape."))
|
=>
|
||||||
|
(lambda (browser-path)
|
||||||
(or (system* netscape-path "-remote" (format "openURL(~a)" str))
|
;; opera may not return -- always open asyncronously
|
||||||
(let-values ([(out in id err status) (apply values (process* netscape-path str))])
|
;; opera starts a new browser automatically, if it can't find one
|
||||||
|
(process* browser-path "-remote" (format "openURL(~a)" str))
|
||||||
|
(void))]
|
||||||
|
[(find-executable-path "netscape" #f)
|
||||||
|
=>
|
||||||
|
(lambda (browser-path)
|
||||||
|
;; netscape's -remote returns with an error code, if no
|
||||||
|
;; netscape is around. start a new netscape in that case.
|
||||||
|
(or (system* browser-path "-remote" (format "openURL(~a)" str))
|
||||||
|
(let-values ([(out in id err status) (apply values (process* browser-path str))])
|
||||||
(close-output-port in)
|
(close-output-port in)
|
||||||
(close-input-port out)
|
(close-input-port out)
|
||||||
(close-input-port err))))]
|
(close-input-port err))))]
|
||||||
|
[else
|
||||||
|
(error 'open-url "Couldn't find Netscape or Opera to open url: ~e" str)])]
|
||||||
[else (error 'send-url "don't know how to open url on platform: ~s" (system-type))])))
|
[else (error 'send-url "don't know how to open url on platform: ~s" (system-type))])))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user