Commit 11b2b9cf authored by Georg Brandl's avatar Georg Brandl

Bug #1338995: fix problem with new webbrowser.py.

parent 1c983276
...@@ -180,8 +180,11 @@ class UnixBrowser(BaseBrowser): ...@@ -180,8 +180,11 @@ class UnixBrowser(BaseBrowser):
cmd += ' &' cmd += ' &'
rc = os.system(cmd) rc = os.system(cmd)
if rc: if rc:
cmd = "%s %s" % (self.name, url)
if self.remote_background:
cmd += " &"
# bad return status, try again with simpler command # bad return status, try again with simpler command
rc = os.system("%s %s" % (self.name, url)) rc = os.system(cmd)
return not rc return not rc
def open(self, url, new=0, autoraise=1): def open(self, url, new=0, autoraise=1):
...@@ -209,6 +212,7 @@ class Mozilla(UnixBrowser): ...@@ -209,6 +212,7 @@ class Mozilla(UnixBrowser):
remote_action = "openURL(%s)" remote_action = "openURL(%s)"
remote_action_newwin = "openURL(%s,new-window)" remote_action_newwin = "openURL(%s,new-window)"
remote_action_newtab = "openURL(%s,new-tab)" remote_action_newtab = "openURL(%s,new-tab)"
remote_background = True
Netscape = Mozilla Netscape = Mozilla
...@@ -240,7 +244,7 @@ class Konqueror(BaseBrowser): ...@@ -240,7 +244,7 @@ class Konqueror(BaseBrowser):
if _iscommand("konqueror"): if _iscommand("konqueror"):
rc = os.system(self.name + " --silent '%s' &" % url) rc = os.system(self.name + " --silent '%s' &" % url)
elif _iscommand("kfm"): elif _iscommand("kfm"):
rc = os.system(self.name + " -d '%s'" % url) rc = os.system(self.name + " -d '%s' &" % url)
return not rc return not rc
def open(self, url, new=0, autoraise=1): def open(self, url, new=0, autoraise=1):
...@@ -264,6 +268,7 @@ class Opera(UnixBrowser): ...@@ -264,6 +268,7 @@ class Opera(UnixBrowser):
remote_action = "openURL(%s)" remote_action = "openURL(%s)"
remote_action_newwin = "openURL(%s,new-window)" remote_action_newwin = "openURL(%s,new-window)"
remote_action_newtab = "openURL(%s,new-page)" remote_action_newtab = "openURL(%s,new-page)"
remote_background = True
class Elinks(UnixBrowser): class Elinks(UnixBrowser):
...@@ -459,7 +464,7 @@ if sys.platform == 'darwin': ...@@ -459,7 +464,7 @@ if sys.platform == 'darwin':
new = int(bool(new)) new = int(bool(new))
if self.name == "default": if self.name == "default":
# User called open, open_new or get without a browser parameter # User called open, open_new or get without a browser parameter
script = _safequote('open location "%s"', url) # opens in default browser script = 'open location "%s"' % url.replace('"', '%22') # opens in default browser
else: else:
# User called get and chose a browser # User called get and chose a browser
if self.name == "OmniWeb": if self.name == "OmniWeb":
...@@ -468,7 +473,7 @@ if sys.platform == 'darwin': ...@@ -468,7 +473,7 @@ if sys.platform == 'darwin':
# Include toWindow parameter of OpenURL command for browsers # Include toWindow parameter of OpenURL command for browsers
# that support it. 0 == new window; -1 == existing # that support it. 0 == new window; -1 == existing
toWindow = "toWindow %d" % (new - 1) toWindow = "toWindow %d" % (new - 1)
cmd = _safequote('OpenURL "%s"', url) cmd = 'OpenURL "%s"' % url.replace('"', '%22')
script = '''tell application "%s" script = '''tell application "%s"
activate activate
%s %s %s %s
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment