Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../lib64/python2....
File: webbrowser.py
#! /usr/bin/python2.7
[0] Fix | Delete
"""Interfaces for launching and remotely controlling Web browsers."""
[1] Fix | Delete
# Maintained by Georg Brandl.
[2] Fix | Delete
[3] Fix | Delete
import os
[4] Fix | Delete
import shlex
[5] Fix | Delete
import sys
[6] Fix | Delete
import stat
[7] Fix | Delete
import subprocess
[8] Fix | Delete
import time
[9] Fix | Delete
[10] Fix | Delete
__all__ = ["Error", "open", "open_new", "open_new_tab", "get", "register"]
[11] Fix | Delete
[12] Fix | Delete
class Error(Exception):
[13] Fix | Delete
pass
[14] Fix | Delete
[15] Fix | Delete
_browsers = {} # Dictionary of available browser controllers
[16] Fix | Delete
_tryorder = [] # Preference order of available browsers
[17] Fix | Delete
[18] Fix | Delete
def register(name, klass, instance=None, update_tryorder=1):
[19] Fix | Delete
"""Register a browser connector and, optionally, connection."""
[20] Fix | Delete
_browsers[name.lower()] = [klass, instance]
[21] Fix | Delete
if update_tryorder > 0:
[22] Fix | Delete
_tryorder.append(name)
[23] Fix | Delete
elif update_tryorder < 0:
[24] Fix | Delete
_tryorder.insert(0, name)
[25] Fix | Delete
[26] Fix | Delete
def get(using=None):
[27] Fix | Delete
"""Return a browser launcher instance appropriate for the environment."""
[28] Fix | Delete
if using is not None:
[29] Fix | Delete
alternatives = [using]
[30] Fix | Delete
else:
[31] Fix | Delete
alternatives = _tryorder
[32] Fix | Delete
for browser in alternatives:
[33] Fix | Delete
if '%s' in browser:
[34] Fix | Delete
# User gave us a command line, split it into name and args
[35] Fix | Delete
browser = shlex.split(browser)
[36] Fix | Delete
if browser[-1] == '&':
[37] Fix | Delete
return BackgroundBrowser(browser[:-1])
[38] Fix | Delete
else:
[39] Fix | Delete
return GenericBrowser(browser)
[40] Fix | Delete
else:
[41] Fix | Delete
# User gave us a browser name or path.
[42] Fix | Delete
try:
[43] Fix | Delete
command = _browsers[browser.lower()]
[44] Fix | Delete
except KeyError:
[45] Fix | Delete
command = _synthesize(browser)
[46] Fix | Delete
if command[1] is not None:
[47] Fix | Delete
return command[1]
[48] Fix | Delete
elif command[0] is not None:
[49] Fix | Delete
return command[0]()
[50] Fix | Delete
raise Error("could not locate runnable browser")
[51] Fix | Delete
[52] Fix | Delete
# Please note: the following definition hides a builtin function.
[53] Fix | Delete
# It is recommended one does "import webbrowser" and uses webbrowser.open(url)
[54] Fix | Delete
# instead of "from webbrowser import *".
[55] Fix | Delete
[56] Fix | Delete
def open(url, new=0, autoraise=True):
[57] Fix | Delete
for name in _tryorder:
[58] Fix | Delete
browser = get(name)
[59] Fix | Delete
if browser.open(url, new, autoraise):
[60] Fix | Delete
return True
[61] Fix | Delete
return False
[62] Fix | Delete
[63] Fix | Delete
def open_new(url):
[64] Fix | Delete
return open(url, 1)
[65] Fix | Delete
[66] Fix | Delete
def open_new_tab(url):
[67] Fix | Delete
return open(url, 2)
[68] Fix | Delete
[69] Fix | Delete
[70] Fix | Delete
def _synthesize(browser, update_tryorder=1):
[71] Fix | Delete
"""Attempt to synthesize a controller base on existing controllers.
[72] Fix | Delete
[73] Fix | Delete
This is useful to create a controller when a user specifies a path to
[74] Fix | Delete
an entry in the BROWSER environment variable -- we can copy a general
[75] Fix | Delete
controller to operate using a specific installation of the desired
[76] Fix | Delete
browser in this way.
[77] Fix | Delete
[78] Fix | Delete
If we can't create a controller in this way, or if there is no
[79] Fix | Delete
executable for the requested browser, return [None, None].
[80] Fix | Delete
[81] Fix | Delete
"""
[82] Fix | Delete
cmd = browser.split()[0]
[83] Fix | Delete
if not _iscommand(cmd):
[84] Fix | Delete
return [None, None]
[85] Fix | Delete
name = os.path.basename(cmd)
[86] Fix | Delete
try:
[87] Fix | Delete
command = _browsers[name.lower()]
[88] Fix | Delete
except KeyError:
[89] Fix | Delete
return [None, None]
[90] Fix | Delete
# now attempt to clone to fit the new name:
[91] Fix | Delete
controller = command[1]
[92] Fix | Delete
if controller and name.lower() == controller.basename:
[93] Fix | Delete
import copy
[94] Fix | Delete
controller = copy.copy(controller)
[95] Fix | Delete
controller.name = browser
[96] Fix | Delete
controller.basename = os.path.basename(browser)
[97] Fix | Delete
register(browser, None, controller, update_tryorder)
[98] Fix | Delete
return [None, controller]
[99] Fix | Delete
return [None, None]
[100] Fix | Delete
[101] Fix | Delete
[102] Fix | Delete
if sys.platform[:3] == "win":
[103] Fix | Delete
def _isexecutable(cmd):
[104] Fix | Delete
cmd = cmd.lower()
[105] Fix | Delete
if os.path.isfile(cmd) and cmd.endswith((".exe", ".bat")):
[106] Fix | Delete
return True
[107] Fix | Delete
for ext in ".exe", ".bat":
[108] Fix | Delete
if os.path.isfile(cmd + ext):
[109] Fix | Delete
return True
[110] Fix | Delete
return False
[111] Fix | Delete
else:
[112] Fix | Delete
def _isexecutable(cmd):
[113] Fix | Delete
if os.path.isfile(cmd):
[114] Fix | Delete
mode = os.stat(cmd)[stat.ST_MODE]
[115] Fix | Delete
if mode & stat.S_IXUSR or mode & stat.S_IXGRP or mode & stat.S_IXOTH:
[116] Fix | Delete
return True
[117] Fix | Delete
return False
[118] Fix | Delete
[119] Fix | Delete
def _iscommand(cmd):
[120] Fix | Delete
"""Return True if cmd is executable or can be found on the executable
[121] Fix | Delete
search path."""
[122] Fix | Delete
if _isexecutable(cmd):
[123] Fix | Delete
return True
[124] Fix | Delete
path = os.environ.get("PATH")
[125] Fix | Delete
if not path:
[126] Fix | Delete
return False
[127] Fix | Delete
for d in path.split(os.pathsep):
[128] Fix | Delete
exe = os.path.join(d, cmd)
[129] Fix | Delete
if _isexecutable(exe):
[130] Fix | Delete
return True
[131] Fix | Delete
return False
[132] Fix | Delete
[133] Fix | Delete
[134] Fix | Delete
# General parent classes
[135] Fix | Delete
[136] Fix | Delete
class BaseBrowser(object):
[137] Fix | Delete
"""Parent class for all browsers. Do not use directly."""
[138] Fix | Delete
[139] Fix | Delete
args = ['%s']
[140] Fix | Delete
[141] Fix | Delete
def __init__(self, name=""):
[142] Fix | Delete
self.name = name
[143] Fix | Delete
self.basename = name
[144] Fix | Delete
[145] Fix | Delete
def open(self, url, new=0, autoraise=True):
[146] Fix | Delete
raise NotImplementedError
[147] Fix | Delete
[148] Fix | Delete
def open_new(self, url):
[149] Fix | Delete
return self.open(url, 1)
[150] Fix | Delete
[151] Fix | Delete
def open_new_tab(self, url):
[152] Fix | Delete
return self.open(url, 2)
[153] Fix | Delete
[154] Fix | Delete
[155] Fix | Delete
class GenericBrowser(BaseBrowser):
[156] Fix | Delete
"""Class for all browsers started with a command
[157] Fix | Delete
and without remote functionality."""
[158] Fix | Delete
[159] Fix | Delete
def __init__(self, name):
[160] Fix | Delete
if isinstance(name, basestring):
[161] Fix | Delete
self.name = name
[162] Fix | Delete
self.args = ["%s"]
[163] Fix | Delete
else:
[164] Fix | Delete
# name should be a list with arguments
[165] Fix | Delete
self.name = name[0]
[166] Fix | Delete
self.args = name[1:]
[167] Fix | Delete
self.basename = os.path.basename(self.name)
[168] Fix | Delete
[169] Fix | Delete
def open(self, url, new=0, autoraise=True):
[170] Fix | Delete
cmdline = [self.name] + [arg.replace("%s", url)
[171] Fix | Delete
for arg in self.args]
[172] Fix | Delete
try:
[173] Fix | Delete
if sys.platform[:3] == 'win':
[174] Fix | Delete
p = subprocess.Popen(cmdline)
[175] Fix | Delete
else:
[176] Fix | Delete
p = subprocess.Popen(cmdline, close_fds=True)
[177] Fix | Delete
return not p.wait()
[178] Fix | Delete
except OSError:
[179] Fix | Delete
return False
[180] Fix | Delete
[181] Fix | Delete
[182] Fix | Delete
class BackgroundBrowser(GenericBrowser):
[183] Fix | Delete
"""Class for all browsers which are to be started in the
[184] Fix | Delete
background."""
[185] Fix | Delete
[186] Fix | Delete
def open(self, url, new=0, autoraise=True):
[187] Fix | Delete
cmdline = [self.name] + [arg.replace("%s", url)
[188] Fix | Delete
for arg in self.args]
[189] Fix | Delete
try:
[190] Fix | Delete
if sys.platform[:3] == 'win':
[191] Fix | Delete
p = subprocess.Popen(cmdline)
[192] Fix | Delete
else:
[193] Fix | Delete
setsid = getattr(os, 'setsid', None)
[194] Fix | Delete
if not setsid:
[195] Fix | Delete
setsid = getattr(os, 'setpgrp', None)
[196] Fix | Delete
p = subprocess.Popen(cmdline, close_fds=True, preexec_fn=setsid)
[197] Fix | Delete
return (p.poll() is None)
[198] Fix | Delete
except OSError:
[199] Fix | Delete
return False
[200] Fix | Delete
[201] Fix | Delete
[202] Fix | Delete
class UnixBrowser(BaseBrowser):
[203] Fix | Delete
"""Parent class for all Unix browsers with remote functionality."""
[204] Fix | Delete
[205] Fix | Delete
raise_opts = None
[206] Fix | Delete
remote_args = ['%action', '%s']
[207] Fix | Delete
remote_action = None
[208] Fix | Delete
remote_action_newwin = None
[209] Fix | Delete
remote_action_newtab = None
[210] Fix | Delete
background = False
[211] Fix | Delete
redirect_stdout = True
[212] Fix | Delete
[213] Fix | Delete
def _invoke(self, args, remote, autoraise):
[214] Fix | Delete
raise_opt = []
[215] Fix | Delete
if remote and self.raise_opts:
[216] Fix | Delete
# use autoraise argument only for remote invocation
[217] Fix | Delete
autoraise = int(autoraise)
[218] Fix | Delete
opt = self.raise_opts[autoraise]
[219] Fix | Delete
if opt: raise_opt = [opt]
[220] Fix | Delete
[221] Fix | Delete
cmdline = [self.name] + raise_opt + args
[222] Fix | Delete
[223] Fix | Delete
if remote or self.background:
[224] Fix | Delete
inout = file(os.devnull, "r+")
[225] Fix | Delete
else:
[226] Fix | Delete
# for TTY browsers, we need stdin/out
[227] Fix | Delete
inout = None
[228] Fix | Delete
# if possible, put browser in separate process group, so
[229] Fix | Delete
# keyboard interrupts don't affect browser as well as Python
[230] Fix | Delete
setsid = getattr(os, 'setsid', None)
[231] Fix | Delete
if not setsid:
[232] Fix | Delete
setsid = getattr(os, 'setpgrp', None)
[233] Fix | Delete
[234] Fix | Delete
p = subprocess.Popen(cmdline, close_fds=True, stdin=inout,
[235] Fix | Delete
stdout=(self.redirect_stdout and inout or None),
[236] Fix | Delete
stderr=inout, preexec_fn=setsid)
[237] Fix | Delete
if remote:
[238] Fix | Delete
# wait five seconds. If the subprocess is not finished, the
[239] Fix | Delete
# remote invocation has (hopefully) started a new instance.
[240] Fix | Delete
time.sleep(1)
[241] Fix | Delete
rc = p.poll()
[242] Fix | Delete
if rc is None:
[243] Fix | Delete
time.sleep(4)
[244] Fix | Delete
rc = p.poll()
[245] Fix | Delete
if rc is None:
[246] Fix | Delete
return True
[247] Fix | Delete
# if remote call failed, open() will try direct invocation
[248] Fix | Delete
return not rc
[249] Fix | Delete
elif self.background:
[250] Fix | Delete
if p.poll() is None:
[251] Fix | Delete
return True
[252] Fix | Delete
else:
[253] Fix | Delete
return False
[254] Fix | Delete
else:
[255] Fix | Delete
return not p.wait()
[256] Fix | Delete
[257] Fix | Delete
def open(self, url, new=0, autoraise=True):
[258] Fix | Delete
if new == 0:
[259] Fix | Delete
action = self.remote_action
[260] Fix | Delete
elif new == 1:
[261] Fix | Delete
action = self.remote_action_newwin
[262] Fix | Delete
elif new == 2:
[263] Fix | Delete
if self.remote_action_newtab is None:
[264] Fix | Delete
action = self.remote_action_newwin
[265] Fix | Delete
else:
[266] Fix | Delete
action = self.remote_action_newtab
[267] Fix | Delete
else:
[268] Fix | Delete
raise Error("Bad 'new' parameter to open(); " +
[269] Fix | Delete
"expected 0, 1, or 2, got %s" % new)
[270] Fix | Delete
[271] Fix | Delete
args = [arg.replace("%s", url).replace("%action", action)
[272] Fix | Delete
for arg in self.remote_args]
[273] Fix | Delete
success = self._invoke(args, True, autoraise)
[274] Fix | Delete
if not success:
[275] Fix | Delete
# remote invocation failed, try straight way
[276] Fix | Delete
args = [arg.replace("%s", url) for arg in self.args]
[277] Fix | Delete
return self._invoke(args, False, False)
[278] Fix | Delete
else:
[279] Fix | Delete
return True
[280] Fix | Delete
[281] Fix | Delete
[282] Fix | Delete
class Mozilla(UnixBrowser):
[283] Fix | Delete
"""Launcher class for Mozilla/Netscape browsers."""
[284] Fix | Delete
[285] Fix | Delete
raise_opts = ["-noraise", "-raise"]
[286] Fix | Delete
remote_args = ['-remote', 'openURL(%s%action)']
[287] Fix | Delete
remote_action = ""
[288] Fix | Delete
remote_action_newwin = ",new-window"
[289] Fix | Delete
remote_action_newtab = ",new-tab"
[290] Fix | Delete
background = True
[291] Fix | Delete
[292] Fix | Delete
Netscape = Mozilla
[293] Fix | Delete
[294] Fix | Delete
[295] Fix | Delete
class Galeon(UnixBrowser):
[296] Fix | Delete
"""Launcher class for Galeon/Epiphany browsers."""
[297] Fix | Delete
[298] Fix | Delete
raise_opts = ["-noraise", ""]
[299] Fix | Delete
remote_args = ['%action', '%s']
[300] Fix | Delete
remote_action = "-n"
[301] Fix | Delete
remote_action_newwin = "-w"
[302] Fix | Delete
background = True
[303] Fix | Delete
[304] Fix | Delete
[305] Fix | Delete
class Chrome(UnixBrowser):
[306] Fix | Delete
"Launcher class for Google Chrome browser."
[307] Fix | Delete
[308] Fix | Delete
remote_args = ['%action', '%s']
[309] Fix | Delete
remote_action = ""
[310] Fix | Delete
remote_action_newwin = "--new-window"
[311] Fix | Delete
remote_action_newtab = ""
[312] Fix | Delete
background = True
[313] Fix | Delete
[314] Fix | Delete
Chromium = Chrome
[315] Fix | Delete
[316] Fix | Delete
[317] Fix | Delete
class Opera(UnixBrowser):
[318] Fix | Delete
"Launcher class for Opera browser."
[319] Fix | Delete
[320] Fix | Delete
remote_args = ['%action', '%s']
[321] Fix | Delete
remote_action = ""
[322] Fix | Delete
remote_action_newwin = "--new-window"
[323] Fix | Delete
remote_action_newtab = ""
[324] Fix | Delete
background = True
[325] Fix | Delete
[326] Fix | Delete
[327] Fix | Delete
class Elinks(UnixBrowser):
[328] Fix | Delete
"Launcher class for Elinks browsers."
[329] Fix | Delete
[330] Fix | Delete
remote_args = ['-remote', 'openURL(%s%action)']
[331] Fix | Delete
remote_action = ""
[332] Fix | Delete
remote_action_newwin = ",new-window"
[333] Fix | Delete
remote_action_newtab = ",new-tab"
[334] Fix | Delete
background = False
[335] Fix | Delete
[336] Fix | Delete
# elinks doesn't like its stdout to be redirected -
[337] Fix | Delete
# it uses redirected stdout as a signal to do -dump
[338] Fix | Delete
redirect_stdout = False
[339] Fix | Delete
[340] Fix | Delete
[341] Fix | Delete
class Konqueror(BaseBrowser):
[342] Fix | Delete
"""Controller for the KDE File Manager (kfm, or Konqueror).
[343] Fix | Delete
[344] Fix | Delete
See the output of ``kfmclient --commands``
[345] Fix | Delete
for more information on the Konqueror remote-control interface.
[346] Fix | Delete
"""
[347] Fix | Delete
[348] Fix | Delete
def open(self, url, new=0, autoraise=True):
[349] Fix | Delete
# XXX Currently I know no way to prevent KFM from opening a new win.
[350] Fix | Delete
if new == 2:
[351] Fix | Delete
action = "newTab"
[352] Fix | Delete
else:
[353] Fix | Delete
action = "openURL"
[354] Fix | Delete
[355] Fix | Delete
devnull = file(os.devnull, "r+")
[356] Fix | Delete
# if possible, put browser in separate process group, so
[357] Fix | Delete
# keyboard interrupts don't affect browser as well as Python
[358] Fix | Delete
setsid = getattr(os, 'setsid', None)
[359] Fix | Delete
if not setsid:
[360] Fix | Delete
setsid = getattr(os, 'setpgrp', None)
[361] Fix | Delete
[362] Fix | Delete
try:
[363] Fix | Delete
p = subprocess.Popen(["kfmclient", action, url],
[364] Fix | Delete
close_fds=True, stdin=devnull,
[365] Fix | Delete
stdout=devnull, stderr=devnull)
[366] Fix | Delete
except OSError:
[367] Fix | Delete
# fall through to next variant
[368] Fix | Delete
pass
[369] Fix | Delete
else:
[370] Fix | Delete
p.wait()
[371] Fix | Delete
# kfmclient's return code unfortunately has no meaning as it seems
[372] Fix | Delete
return True
[373] Fix | Delete
[374] Fix | Delete
try:
[375] Fix | Delete
p = subprocess.Popen(["konqueror", "--silent", url],
[376] Fix | Delete
close_fds=True, stdin=devnull,
[377] Fix | Delete
stdout=devnull, stderr=devnull,
[378] Fix | Delete
preexec_fn=setsid)
[379] Fix | Delete
except OSError:
[380] Fix | Delete
# fall through to next variant
[381] Fix | Delete
pass
[382] Fix | Delete
else:
[383] Fix | Delete
if p.poll() is None:
[384] Fix | Delete
# Should be running now.
[385] Fix | Delete
return True
[386] Fix | Delete
[387] Fix | Delete
try:
[388] Fix | Delete
p = subprocess.Popen(["kfm", "-d", url],
[389] Fix | Delete
close_fds=True, stdin=devnull,
[390] Fix | Delete
stdout=devnull, stderr=devnull,
[391] Fix | Delete
preexec_fn=setsid)
[392] Fix | Delete
except OSError:
[393] Fix | Delete
return False
[394] Fix | Delete
else:
[395] Fix | Delete
return (p.poll() is None)
[396] Fix | Delete
[397] Fix | Delete
[398] Fix | Delete
class Grail(BaseBrowser):
[399] Fix | Delete
# There should be a way to maintain a connection to Grail, but the
[400] Fix | Delete
# Grail remote control protocol doesn't really allow that at this
[401] Fix | Delete
# point. It probably never will!
[402] Fix | Delete
def _find_grail_rc(self):
[403] Fix | Delete
import glob
[404] Fix | Delete
import pwd
[405] Fix | Delete
import socket
[406] Fix | Delete
import tempfile
[407] Fix | Delete
tempdir = os.path.join(tempfile.gettempdir(),
[408] Fix | Delete
".grail-unix")
[409] Fix | Delete
user = pwd.getpwuid(os.getuid())[0]
[410] Fix | Delete
filename = os.path.join(tempdir, user + "-*")
[411] Fix | Delete
maybes = glob.glob(filename)
[412] Fix | Delete
if not maybes:
[413] Fix | Delete
return None
[414] Fix | Delete
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
[415] Fix | Delete
for fn in maybes:
[416] Fix | Delete
# need to PING each one until we find one that's live
[417] Fix | Delete
try:
[418] Fix | Delete
s.connect(fn)
[419] Fix | Delete
except socket.error:
[420] Fix | Delete
# no good; attempt to clean it out, but don't fail:
[421] Fix | Delete
try:
[422] Fix | Delete
os.unlink(fn)
[423] Fix | Delete
except IOError:
[424] Fix | Delete
pass
[425] Fix | Delete
else:
[426] Fix | Delete
return s
[427] Fix | Delete
[428] Fix | Delete
def _remote(self, action):
[429] Fix | Delete
s = self._find_grail_rc()
[430] Fix | Delete
if not s:
[431] Fix | Delete
return 0
[432] Fix | Delete
s.send(action)
[433] Fix | Delete
s.close()
[434] Fix | Delete
return 1
[435] Fix | Delete
[436] Fix | Delete
def open(self, url, new=0, autoraise=True):
[437] Fix | Delete
if new:
[438] Fix | Delete
ok = self._remote("LOADNEW " + url)
[439] Fix | Delete
else:
[440] Fix | Delete
ok = self._remote("LOAD " + url)
[441] Fix | Delete
return ok
[442] Fix | Delete
[443] Fix | Delete
[444] Fix | Delete
#
[445] Fix | Delete
# Platform support for Unix
[446] Fix | Delete
#
[447] Fix | Delete
[448] Fix | Delete
# These are the right tests because all these Unix browsers require either
[449] Fix | Delete
# a console terminal or an X display to run.
[450] Fix | Delete
[451] Fix | Delete
def register_X_browsers():
[452] Fix | Delete
[453] Fix | Delete
# use xdg-open if around
[454] Fix | Delete
if _iscommand("xdg-open"):
[455] Fix | Delete
register("xdg-open", None, BackgroundBrowser("xdg-open"))
[456] Fix | Delete
[457] Fix | Delete
# The default GNOME3 browser
[458] Fix | Delete
if "GNOME_DESKTOP_SESSION_ID" in os.environ and _iscommand("gvfs-open"):
[459] Fix | Delete
register("gvfs-open", None, BackgroundBrowser("gvfs-open"))
[460] Fix | Delete
[461] Fix | Delete
# The default GNOME browser
[462] Fix | Delete
if "GNOME_DESKTOP_SESSION_ID" in os.environ and _iscommand("gnome-open"):
[463] Fix | Delete
register("gnome-open", None, BackgroundBrowser("gnome-open"))
[464] Fix | Delete
[465] Fix | Delete
# The default KDE browser
[466] Fix | Delete
if "KDE_FULL_SESSION" in os.environ and _iscommand("kfmclient"):
[467] Fix | Delete
register("kfmclient", Konqueror, Konqueror("kfmclient"))
[468] Fix | Delete
[469] Fix | Delete
if _iscommand("x-www-browser"):
[470] Fix | Delete
register("x-www-browser", None, BackgroundBrowser("x-www-browser"))
[471] Fix | Delete
[472] Fix | Delete
# The Mozilla/Netscape browsers
[473] Fix | Delete
for browser in ("mozilla-firefox", "firefox",
[474] Fix | Delete
"mozilla-firebird", "firebird",
[475] Fix | Delete
"iceweasel", "iceape",
[476] Fix | Delete
"seamonkey", "mozilla", "netscape"):
[477] Fix | Delete
if _iscommand(browser):
[478] Fix | Delete
register(browser, None, Mozilla(browser))
[479] Fix | Delete
[480] Fix | Delete
# Konqueror/kfm, the KDE browser.
[481] Fix | Delete
if _iscommand("kfm"):
[482] Fix | Delete
register("kfm", Konqueror, Konqueror("kfm"))
[483] Fix | Delete
elif _iscommand("konqueror"):
[484] Fix | Delete
register("konqueror", Konqueror, Konqueror("konqueror"))
[485] Fix | Delete
[486] Fix | Delete
# Gnome's Galeon and Epiphany
[487] Fix | Delete
for browser in ("galeon", "epiphany"):
[488] Fix | Delete
if _iscommand(browser):
[489] Fix | Delete
register(browser, None, Galeon(browser))
[490] Fix | Delete
[491] Fix | Delete
# Skipstone, another Gtk/Mozilla based browser
[492] Fix | Delete
if _iscommand("skipstone"):
[493] Fix | Delete
register("skipstone", None, BackgroundBrowser("skipstone"))
[494] Fix | Delete
[495] Fix | Delete
# Google Chrome/Chromium browsers
[496] Fix | Delete
for browser in ("google-chrome", "chrome", "chromium", "chromium-browser"):
[497] Fix | Delete
if _iscommand(browser):
[498] Fix | Delete
register(browser, None, Chrome(browser))
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function