[or-cvs] [torbutton/master] changed Open as Tor URL into two options: "Open Tor URL in New Tab" and "Open Tor URL in New Window"

mikeperry at seul.org mikeperry at seul.org
Wed Sep 23 23:49:09 UTC 2009


Author: Kory Kork <kory at korykirk.com>
Date: Tue, 21 Jul 2009 01:01:25 +0000
Subject: changed Open as Tor URL into two options: "Open Tor URL in New Tab" and "Open Tor URL in New Window"
Commit: 4f5ea78c8cfff11d8bc32a1729395f60009c54bf

svn:r20095
---
 src/chrome/content/torbutton.js  |    9 ++++++---
 src/chrome/content/torbutton.xul |   13 ++++++++++---
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index 8c1dfd6..e31e18e 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -480,7 +480,7 @@ function torbutton_copyToClipboard(copyThis) {
 	return true;
 }
 //opens new tab with link with tor:// protocol
-function torbutton_open_link_as_tor() {
+function torbutton_open_link_as_tor(tabFlag) {
   var element = document.popupNode;
   var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                    .getInterface(Components.interfaces.nsIWebNavigation)
@@ -498,8 +498,11 @@ function torbutton_open_link_as_tor() {
   else if (myURI.scheme == "https" || myURI.scheme == "tors")
     myURI.scheme = "tors";
     else
-      return;//unsupported scheme    
-  mainWindow.getBrowser().addTab(myURI.spec);    
+      return;//unsupported scheme
+  if (tabFlag)
+    mainWindow.getBrowser().addTab(myURI.spec);
+   else
+    mainWindow.open(myURI.spec);    
 }
 
 // this function duplicates a lot of code in preferences.js for deciding our
diff --git a/src/chrome/content/torbutton.xul b/src/chrome/content/torbutton.xul
index e339944..6917d1d 100644
--- a/src/chrome/content/torbutton.xul
+++ b/src/chrome/content/torbutton.xul
@@ -53,10 +53,17 @@
 					insertafter="context-copylink"
 					oncommand="torbutton_copy_link();"/>  
 			    <menuitem 
-					id="torcontext-opentorurl"
-					label="Open Link as Tor URL" 
+					id="torcontext-opentortab"
+					label="Open Tor URL in New Tab" 
 					accesskey="r" 
 					insertafter="context-openlinkintab"					
-					oncommand="torbutton_open_link_as_tor();"/>
+					oncommand="torbutton_open_link_as_tor(true);"/>
+					<menuitem 
+					id="torcontext-opentorwin"
+					label="Open Tor URL in New Window" 
+					accesskey="d" 
+					insertafter="context-openlinkintab"					
+					oncommand="torbutton_open_link_as_tor(false);"/>
+					
   </popup>
 </overlay>
-- 
1.5.6.5




More information about the tor-commits mailing list