Skip to content

Commit

Permalink
add option to disable accepting links (partial fix for torproject#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
micahflee authored and h01ger committed Feb 4, 2015
1 parent b69ff57 commit 70d0c57
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
3 changes: 2 additions & 1 deletion torbrowser_launcher/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ def load_settings(self):
'check_for_updates': False,
'modem_sound': False,
'last_update_check_timestamp': 0,
'mirror': self.default_mirror
'mirror': self.default_mirror,
'accept_links': False
}

if os.path.isfile(self.paths['settings_file']):
Expand Down
5 changes: 4 additions & 1 deletion torbrowser_launcher/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,10 @@ def play_modem_sound():
gtk.main_iteration_do(True)

# run Tor Browser
subprocess.call([self.common.paths['tbb']['start'], '-allow-remote'] + self.url_list)
if self.common.settings['accept_links']:
subprocess.call([self.common.paths['tbb']['start'], '-allow-remote'] + self.url_list)
else:
subprocess.call([self.common.paths['tbb']['start']])

if run_next_task:
self.run_task()
Expand Down
10 changes: 10 additions & 0 deletions torbrowser_launcher/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ def __init__(self, common):
self.update_checkbox.set_active(False)
self.update_checkbox.show()

# accept links
self.accept_links = gtk.CheckButton(_("Allow opening links with Tor Browser\n(this doesn't work if you use Firefox)"))
self.settings_box.pack_start(self.accept_links, True, True, 0)
if self.common.settings['accept_links']:
self.accept_links.set_active(True)
else:
self.accept_links.set_active(False)
self.accept_links.show()

# modem sound
self.modem_checkbox = gtk.CheckButton(_("Play modem sound, because Tor is slow :]"))
self.settings_box.pack_start(self.modem_checkbox, True, True, 0)
Expand Down Expand Up @@ -213,6 +222,7 @@ def save(self):
# checkbox options
self.common.settings['update_over_tor'] = self.tor_update_checkbox.get_active()
self.common.settings['check_for_updates'] = self.update_checkbox.get_active()
self.common.settings['accept_links'] = self.accept_links.get_active()
self.common.settings['modem_sound'] = self.modem_checkbox.get_active()

# figure out the selected mirror
Expand Down

0 comments on commit 70d0c57

Please sign in to comment.