Add option to force opening links in new browser window
This commit is contained in:
@@ -261,6 +261,7 @@ class Config(object):
|
|||||||
if config.has_section('rtv'):
|
if config.has_section('rtv'):
|
||||||
rtv = dict(config.items('rtv'))
|
rtv = dict(config.items('rtv'))
|
||||||
|
|
||||||
|
# convert non-string params to their typed representation
|
||||||
params = {
|
params = {
|
||||||
'ascii': partial(config.getboolean, 'rtv'),
|
'ascii': partial(config.getboolean, 'rtv'),
|
||||||
'monochrome': partial(config.getboolean, 'rtv'),
|
'monochrome': partial(config.getboolean, 'rtv'),
|
||||||
@@ -274,7 +275,8 @@ class Config(object):
|
|||||||
'max_comment_cols': partial(config.getint, 'rtv'),
|
'max_comment_cols': partial(config.getint, 'rtv'),
|
||||||
'max_pager_cols': partial(config.getint, 'rtv'),
|
'max_pager_cols': partial(config.getint, 'rtv'),
|
||||||
'hide_username': partial(config.getboolean, 'rtv'),
|
'hide_username': partial(config.getboolean, 'rtv'),
|
||||||
'flash': partial(config.getboolean, 'rtv')
|
'flash': partial(config.getboolean, 'rtv'),
|
||||||
|
'force_new_browser_window': partial(config.getboolean, 'rtv')
|
||||||
}
|
}
|
||||||
|
|
||||||
for key, func in params.items():
|
for key, func in params.items():
|
||||||
|
|||||||
@@ -82,6 +82,9 @@ oauth_scope = edit,history,identity,mysubreddits,privatemessages,read,report,sav
|
|||||||
; See https://imgur.com/account/settings/apps to generate your own key.
|
; See https://imgur.com/account/settings/apps to generate your own key.
|
||||||
imgur_client_id = 93396265f59dec9
|
imgur_client_id = 93396265f59dec9
|
||||||
|
|
||||||
|
; Open a new browser window instead of a new tab in existing instance
|
||||||
|
force_new_browser_window = False
|
||||||
|
|
||||||
[bindings]
|
[bindings]
|
||||||
##############
|
##############
|
||||||
# Key Bindings
|
# Key Bindings
|
||||||
|
|||||||
@@ -599,7 +599,10 @@ class Terminal(object):
|
|||||||
try:
|
try:
|
||||||
os.dup2(null, 1)
|
os.dup2(null, 1)
|
||||||
os.dup2(null, 2)
|
os.dup2(null, 2)
|
||||||
webbrowser.open_new_tab(url)
|
if self.config['force_new_browser_window']:
|
||||||
|
webbrowser.open_new(url)
|
||||||
|
else:
|
||||||
|
webbrowser.open_new_tab(url)
|
||||||
finally:
|
finally:
|
||||||
try:
|
try:
|
||||||
os.close(null)
|
os.close(null)
|
||||||
|
|||||||
Reference in New Issue
Block a user