[tor-commits] [torbrowser/master] Fix for 4192.
erinn at torproject.org
erinn at torproject.org
Sun Oct 23 23:18:33 UTC 2011
commit dd8d5dcb03ffaf2d15747608178a9d3b2888f559
Author: Mike Perry <mikeperry-git at fscked.org>
Date: Sun Oct 9 22:55:00 2011 -0700
Fix for 4192.
It ain't pretty. It just exits if we don't have a TBB profile.
---
...owser-exit-when-not-launched-from-Vidalia.patch | 46 ++++++++++++++++++++
1 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/src/current-patches/0009-Make-Tor-Browser-exit-when-not-launched-from-Vidalia.patch b/src/current-patches/0009-Make-Tor-Browser-exit-when-not-launched-from-Vidalia.patch
new file mode 100644
index 0000000..6659770
--- /dev/null
+++ b/src/current-patches/0009-Make-Tor-Browser-exit-when-not-launched-from-Vidalia.patch
@@ -0,0 +1,46 @@
+From 369d7df54fe13dd69a069a43959bdabcc364e6e4 Mon Sep 17 00:00:00 2001
+From: Mike Perry <mikeperry-git at fscked.org>
+Date: Sun, 9 Oct 2011 22:50:07 -0700
+Subject: [PATCH] Make Tor Browser exit when not launched from Vidalia
+
+Turns out the Windows 7 UI encourages users to "dock" their Tor Browser app
+for easy relaunch. If they manage to do this, we should fail closed rather
+than opened. Hopefully they will get the hint and dock Vidalia instead.
+
+This is an emergency fix for
+https://trac.torproject.org/projects/tor/ticket/4192. We can do a better
+localized fix w/ a translated alert menu later, if it seems like this might
+actually be common.
+---
+ browser/base/content/browser.js | 15 +++++++++++++++
+ 1 files changed, 15 insertions(+), 0 deletions(-)
+
+diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
+index 50f6963..ed2812c 100644
+--- a/browser/base/content/browser.js
++++ b/browser/base/content/browser.js
+@@ -1203,6 +1203,21 @@ function BrowserStartup() {
+
+ prepareForStartup();
+
++ // If this is not a TBB profile, exit.
++ // Solves https://trac.torproject.org/projects/tor/ticket/4192
++ var foundPref = false;
++ try {
++ foundPref = gPrefService.prefHasUserValue("torbrowser.version");
++ } catch(e) {
++ //dump("No pref: "+e);
++ }
++ if(!foundPref) {
++ var appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"]
++ .getService(Components.interfaces.nsIAppStartup);
++ appStartup.quit(3); // Force all windows to close, and then quit.
++ }
++
++
+ if (uriToLoad && !isLoadingBlank) {
+ if (uriToLoad instanceof Ci.nsISupportsArray) {
+ let count = uriToLoad.Count();
+--
+1.7.3.4
+
More information about the tor-commits
mailing list