From 08b3820c088861dddf37a67ffc1ff93a78aad265 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Thu, 26 Feb 2009 15:13:19 +0200 Subject: [PATCH] open in new tab on middle-click --- chrome/button.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/chrome/button.js b/chrome/button.js index 3dadd3e..823c2af 100644 --- a/chrome/button.js +++ b/chrome/button.js @@ -26,14 +26,28 @@ function getClipboardText() { return text; } -function lookup_bts() { +function lookup_bts(in_new) { var bug = getClipboardText(); - loadURI("http://bugs.debian.org/" + bug); + if (!bug) return null; + bug = bug.replace(/^#/, ''); + var uri="http://bugs.debian.org/" + bug; + + if (in_new) { + var b = getBrowser(); + var new_tab = b.addTab(uri); + b.selectedTab = new_tab; + } + else { + loadURI(uri); + } } Debian = { btsButton: function (e) { - lookup_bts(); + if ( e.button == 0 ) + lookup_bts(false) + else if ( e.button == 1 ) + lookup_bts(true); } } -- 2.39.5