aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--platform/chromium/vapi-background.js13
-rw-r--r--platform/firefox/vapi-background.js20
-rw-r--r--src/js/popup.js5
-rw-r--r--src/popup.html4
4 files changed, 37 insertions, 5 deletions
diff --git a/platform/chromium/vapi-background.js b/platform/chromium/vapi-background.js
index 85bdec7..8609a90 100644
--- a/platform/chromium/vapi-background.js
+++ b/platform/chromium/vapi-background.js
@@ -286,7 +286,8 @@ vAPI.tabs.get = function(tabId, callback) {
// tabId: 1, // the tab is used if set, instead of creating a new one
// index: -1, // undefined: end of the list, -1: following tab, or after index
// active: false, // opens the tab in background - true and undefined: foreground
-// select: true // if a tab is already opened with that url, then select it instead of opening a new one
+// select: true, // if a tab is already opened with that url, then select it instead of opening a new one
+// popup: true // open in a new window
vAPI.tabs.open = function(details) {
var targetURL = details.url;
@@ -338,6 +339,16 @@ vAPI.tabs.open = function(details) {
});
};
+ // Open in a standalone window
+ if ( details.popup === true ) {
+ chrome.windows.create({
+ url: details.url,
+ focused: details.active,
+ type: 'popup'
+ });
+ return;
+ }
+
if ( details.index !== -1 ) {
subWrapper();
return;
diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js
index fd070fa..0b1090d 100644
--- a/platform/firefox/vapi-background.js
+++ b/platform/firefox/vapi-background.js
@@ -699,7 +699,19 @@ vAPI.tabs.open = function(details) {
details.index = tabBrowser.browsers.indexOf(tabBrowser.selectedBrowser) + 1;
}
- tab = tabBrowser.loadOneTab(details.url, {inBackground: !details.active});
+ // Open in a standalone window
+ if ( details.popup === true ) {
+ win = Services.ww.openWindow(
+ win,
+ details.url,
+ null,
+ 'menubar=no,toolbar=no,location=no',
+ null
+ );
+ return;
+ }
+
+ tab = tabBrowser.loadOneTab(details.url, { inBackground: !details.active });
if ( details.index !== undefined ) {
tabBrowser.moveTabTo(tab, details.index);
@@ -2683,6 +2695,12 @@ vAPI.contextMenu.unregister = function(doc) {
}
var menuitem = doc.getElementById(this.menuItemId);
+
+ // Not guarantee the menu item was actually registered.
+ if ( menuitem === null ) {
+ return;
+ }
+
var contextMenu = menuitem.parentNode;
menuitem.removeEventListener('command', this.onCommand);
contextMenu.removeEventListener('popupshowing', this.displayMenuItem);
diff --git a/src/js/popup.js b/src/js/popup.js
index 3097536..d4dadba 100644
--- a/src/js/popup.js
+++ b/src/js/popup.js
@@ -526,12 +526,15 @@ var gotoURL = function(ev) {
ev.preventDefault();
+ var rel = this.getAttribute('rel') || '';
+
messager.send({
what: 'gotoURL',
details: {
url: this.getAttribute('href'),
select: true,
- index: -1
+ index: -1,
+ popup: rel === 'popup'
}
});
diff --git a/src/popup.html b/src/popup.html
index 3e91b2a..ef35b56 100644
--- a/src/popup.html
+++ b/src/popup.html
@@ -18,8 +18,8 @@
<p class="statName">
<span data-i18n="popupBlockedOnThisPagePrompt">&nbsp;</span>&ensp;
<span id="gotoPick" class="fa tool" data-i18n-tip="popupTipPicker">&#xf1fb;</span>&ensp;
- <a href="logger-ui.html" target="_blank" id="gotoLog" class="fa tool enabled" data-i18n-tip="popupTipLog">&#xf022;</a>
- </p>
+ <a href="logger-ui.html" rel="popup" class="fa tool enabled" data-i18n-tip="popupTipLog">&#xf022;</a>
+ </p>
<p class="statValue" id="page-blocked">?</p>
<p class="statName" data-i18n="popupBlockedSinceInstallPrompt">&nbsp;</p>
<p class="statValue" id="total-blocked">?</p>