@@ -292,19 +292,8 @@ class Mozilla(UnixBrowser):
292292 background = True
293293
294294
295- class Netscape (UnixBrowser ):
296- """Launcher class for Netscape browser."""
297-
298- raise_opts = ["-noraise" , "-raise" ]
299- remote_args = ['-remote' , 'openURL(%s%action)' ]
300- remote_action = ""
301- remote_action_newwin = ",new-window"
302- remote_action_newtab = ",new-tab"
303- background = True
304-
305-
306- class Galeon (UnixBrowser ):
307- """Launcher class for Galeon/Epiphany browsers."""
295+ class Epiphany (UnixBrowser ):
296+ """Launcher class for Epiphany browser."""
308297
309298 raise_opts = ["-noraise" , "" ]
310299 remote_args = ['%action' , '%s' ]
@@ -402,44 +391,6 @@ def open(self, url, new=0, autoraise=True):
402391 return (p .poll () is None )
403392
404393
405- class Grail (BaseBrowser ):
406- # There should be a way to maintain a connection to Grail, but the
407- # Grail remote control protocol doesn't really allow that at this
408- # point. It probably never will!
409- def _find_grail_rc (self ):
410- import glob
411- import pwd
412- import socket
413- import tempfile
414- tempdir = os .path .join (tempfile .gettempdir (),
415- ".grail-unix" )
416- user = pwd .getpwuid (os .getuid ())[0 ]
417- filename = os .path .join (glob .escape (tempdir ), glob .escape (user ) + "-*" )
418- maybes = glob .glob (filename )
419- if not maybes :
420- return None
421- s = socket .socket (socket .AF_UNIX , socket .SOCK_STREAM )
422- for fn in maybes :
423- # need to PING each one until we find one that's live
424- try :
425- s .connect (fn )
426- except OSError :
427- # no good; attempt to clean it out, but don't fail:
428- try :
429- os .unlink (fn )
430- except OSError :
431- pass
432- else :
433- return s
434-
435- def _remote (self , action ):
436- s = self ._find_grail_rc ()
437- if not s :
438- return 0
439- s .send (action )
440- s .close ()
441- return 1
442-
443394 def open (self , url , new = 0 , autoraise = True ):
444395 sys .audit ("webbrowser.open" , url )
445396 if new :
@@ -475,35 +426,25 @@ def register_X_browsers():
475426 if "KDE_FULL_SESSION" in os .environ and shutil .which ("kfmclient" ):
476427 register ("kfmclient" , Konqueror , Konqueror ("kfmclient" ))
477428
429+ # Common symbolic link for the default X11 browser
478430 if shutil .which ("x-www-browser" ):
479431 register ("x-www-browser" , None , BackgroundBrowser ("x-www-browser" ))
480432
481433 # The Mozilla browsers
482- for browser in ("firefox" , "iceweasel" , "iceape" , "seamonkey" ):
434+ for browser in ("firefox" , "iceweasel" , "seamonkey" , "mozilla-firefox" ,
435+ "mozilla" ):
483436 if shutil .which (browser ):
484437 register (browser , None , Mozilla (browser ))
485438
486- # The Netscape and old Mozilla browsers
487- for browser in ("mozilla-firefox" ,
488- "mozilla-firebird" , "firebird" ,
489- "mozilla" , "netscape" ):
490- if shutil .which (browser ):
491- register (browser , None , Netscape (browser ))
492-
493439 # Konqueror/kfm, the KDE browser.
494440 if shutil .which ("kfm" ):
495441 register ("kfm" , Konqueror , Konqueror ("kfm" ))
496442 elif shutil .which ("konqueror" ):
497443 register ("konqueror" , Konqueror , Konqueror ("konqueror" ))
498444
499- # Gnome's Galeon and Epiphany
500- for browser in ("galeon" , "epiphany" ):
501- if shutil .which (browser ):
502- register (browser , None , Galeon (browser ))
503-
504- # Skipstone, another Gtk/Mozilla based browser
505- if shutil .which ("skipstone" ):
506- register ("skipstone" , None , BackgroundBrowser ("skipstone" ))
445+ # Gnome's Epiphany
446+ if shutil .which ("epiphany" ):
447+ register ("epiphany" , None , Epiphany ("epiphany" ))
507448
508449 # Google Chrome/Chromium browsers
509450 for browser in ("google-chrome" , "chrome" , "chromium" , "chromium-browser" ):
@@ -514,13 +455,6 @@ def register_X_browsers():
514455 if shutil .which ("opera" ):
515456 register ("opera" , None , Opera ("opera" ))
516457
517- # Next, Mosaic -- old but still in use.
518- if shutil .which ("mosaic" ):
519- register ("mosaic" , None , BackgroundBrowser ("mosaic" ))
520-
521- # Grail, the Python browser. Does anybody still use it?
522- if shutil .which ("grail" ):
523- register ("grail" , Grail , None )
524458
525459def register_standard_browsers ():
526460 global _tryorder
@@ -549,7 +483,7 @@ def register_standard_browsers():
549483 # location in 32-bit Windows
550484 edge32 = os .path .join (os .environ .get ("PROGRAMFILES" , "C:\\ Program Files" ),
551485 "Microsoft\\ Edge\\ Application\\ msedge.exe" )
552- for browser in ("firefox" , "firebird " , "seamonkey " , "mozilla " ,
486+ for browser in ("firefox" , "seamonkey " , "mozilla " , "chrome " ,
553487 "opera" , edge64 , edge32 ):
554488 if shutil .which (browser ):
555489 register (browser , None , BackgroundBrowser (browser ))
@@ -570,14 +504,15 @@ def register_standard_browsers():
570504
571505 # Also try console browsers
572506 if os .environ .get ("TERM" ):
507+ # Common symbolic link for the default text-based browser
573508 if shutil .which ("www-browser" ):
574509 register ("www-browser" , None , GenericBrowser ("www-browser" ))
575- # The Links/elinks browsers <http://artax.karlin.mff.cuni.cz/~mikulas/links />
510+ # The Links/elinks browsers <http://links.twibright.com />
576511 if shutil .which ("links" ):
577512 register ("links" , None , GenericBrowser ("links" ))
578513 if shutil .which ("elinks" ):
579514 register ("elinks" , None , Elinks ("elinks" ))
580- # The Lynx browser <http ://lynx.isc.org />, <http://lynx.browser.org/>
515+ # The Lynx browser <https ://lynx.invisible-island.net />, <http://lynx.browser.org/>
581516 if shutil .which ("lynx" ):
582517 register ("lynx" , None , GenericBrowser ("lynx" ))
583518 # The w3m browser <http://w3m.sourceforge.net/>
@@ -727,7 +662,7 @@ def main():
727662 for o , a in opts :
728663 if o == '-n' : new_win = 1
729664 elif o == '-t' : new_win = 2
730- elif o == '-h' or o == '--help' :
665+ elif o == '-h' or o == '--help' :
731666 print (usage , file = sys .stderr )
732667 sys .exit ()
733668 if len (args ) != 1 :
0 commit comments