[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r20095: {torbutton} changed Open as Tor URL into two options: "Open Tor URL in N (torbutton/branches/gsoc2009-koryk/src/chrome/content)
Author: koryk
Date: 2009-07-20 21:01:25 -0400 (Mon, 20 Jul 2009)
New Revision: 20095
Modified:
torbutton/branches/gsoc2009-koryk/src/chrome/content/torbutton.js
torbutton/branches/gsoc2009-koryk/src/chrome/content/torbutton.xul
Log:
changed Open as Tor URL into two options: "Open Tor URL in New Tab" and "Open Tor URL in New Window"
Modified: torbutton/branches/gsoc2009-koryk/src/chrome/content/torbutton.js
===================================================================
--- torbutton/branches/gsoc2009-koryk/src/chrome/content/torbutton.js 2009-07-20 15:30:34 UTC (rev 20094)
+++ torbutton/branches/gsoc2009-koryk/src/chrome/content/torbutton.js 2009-07-21 01:01:25 UTC (rev 20095)
@@ -480,7 +480,7 @@
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 @@
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
Modified: torbutton/branches/gsoc2009-koryk/src/chrome/content/torbutton.xul
===================================================================
--- torbutton/branches/gsoc2009-koryk/src/chrome/content/torbutton.xul 2009-07-20 15:30:34 UTC (rev 20094)
+++ torbutton/branches/gsoc2009-koryk/src/chrome/content/torbutton.xul 2009-07-21 01:01:25 UTC (rev 20095)
@@ -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>