[Pkg-anonymity-tools] [torbrowser-launcher] 01/04: add option to disable accepting links (partial fix for #157)

Holger Levsen holger at moszumanska.debian.org
Sun Jan 25 15:06:03 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to annotated tag v0.1.9
in repository torbrowser-launcher.

commit 3f1146e1a084c4e8021da968104cbc2877ae01e6
Author: Micah Lee <micah at micahflee.com>
Date:   Wed Jan 21 11:54:03 2015 -0800

    add option to disable accepting links (partial fix for #157)
---
 torbrowser_launcher/common.py   |  3 ++-
 torbrowser_launcher/launcher.py |  5 ++++-
 torbrowser_launcher/settings.py | 10 ++++++++++
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/torbrowser_launcher/common.py b/torbrowser_launcher/common.py
index 139e536..505a4b3 100644
--- a/torbrowser_launcher/common.py
+++ b/torbrowser_launcher/common.py
@@ -198,7 +198,8 @@ class Common:
             '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']):
diff --git a/torbrowser_launcher/launcher.py b/torbrowser_launcher/launcher.py
index 8fa6c8a..00bc5a4 100644
--- a/torbrowser_launcher/launcher.py
+++ b/torbrowser_launcher/launcher.py
@@ -634,7 +634,10 @@ class Launcher:
                 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()
diff --git a/torbrowser_launcher/settings.py b/torbrowser_launcher/settings.py
index 0aba63b..a29c41a 100644
--- a/torbrowser_launcher/settings.py
+++ b/torbrowser_launcher/settings.py
@@ -95,6 +95,15 @@ class Settings:
             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)
@@ -213,6 +222,7 @@ class Settings:
         # 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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/torbrowser-launcher.git



More information about the Pkg-anonymity-tools mailing list