From 806cd0426f0c7eefe86066cf7e7d50307322f1fb Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Mon, 2 Jun 2008 23:34:25 +0000 Subject: [PATCH] * Updated browser list, mainly moving gnome-open down because it does not handle file:// URLs with a query part. * Removed unused argument to `browser-run' * Made `browser-run' wait just a little in case we get an error message from the subprocess (to avoid plt-help from exiting immediately) svn: r10095 original commit: f0e71a0c1ca402644be406a761198e5fc54404e0 --- collects/net/sendurl.ss | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/collects/net/sendurl.ss b/collects/net/sendurl.ss index 7744cfbca7..93fb823741 100644 --- a/collects/net/sendurl.ss +++ b/collects/net/sendurl.ss @@ -18,10 +18,22 @@ ;; all possible unix browsers, filtered later to just existing executables ;; order matters: the default will be the first of these that is found (define all-unix-browsers - '(gnome-open firefox galeon opera mozilla konqueror camino skipstone - epiphany seamonkey netscape dillo mosaic - ;; a configurable thing that is deprecated - htmlview)) + '(;; common browsers + firefox galeon opera mozilla konqueror seamonkey epiphany + ;; known browsers + camino skipstone + ;; broken browsers (broken in that they won't work with plt-help) + ;; this is a configurable thing that is deprecated, but better + ;; than gnome-open (because it works) + htmlview + ;; gnome-open could be high, but the problem is that it doesn't + ;; handle file:// URLs with a query string. + gnome-open + ;; dillo does not have javascript + dillo + ;; ancient browsers + netscape mosaic + )) ;; : any -> bool (define (custom-browser? x) @@ -227,13 +239,16 @@ #:delete-at 15))) ;; Process helper -(define (browser-run #:shell [shell? #f] #:ignore-exit-code [nowait? #f] . args) +(define (browser-run #:shell [shell? #f] . args) (define-values (stdout stdin pid stderr control) (apply values (apply (if shell? process/ports process*/ports) (open-output-nowhere) #f (current-error-port) args))) (close-output-port stdin) - (unless nowait? + ;; this is called from plt-help which will immediately exit when we + ;; return, so wait just a little bit in case we'll catch an error + ;; starting the browser + (sync/timeout 0.25 (thread (lambda () (control 'wait) (when (eq? 'done-error (control 'status))