mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-02 17:19:38 +02:00
have the logger open in a separate window
This commit is contained in:
parent
a0607702b1
commit
ad827576ce
@ -286,7 +286,8 @@ vAPI.tabs.get = function(tabId, callback) {
|
|||||||
// tabId: 1, // the tab is used if set, instead of creating a new one
|
// 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
|
// index: -1, // undefined: end of the list, -1: following tab, or after index
|
||||||
// active: false, // opens the tab in background - true and undefined: foreground
|
// 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) {
|
vAPI.tabs.open = function(details) {
|
||||||
var targetURL = details.url;
|
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 ) {
|
if ( details.index !== -1 ) {
|
||||||
subWrapper();
|
subWrapper();
|
||||||
return;
|
return;
|
||||||
|
@ -699,7 +699,19 @@ vAPI.tabs.open = function(details) {
|
|||||||
details.index = tabBrowser.browsers.indexOf(tabBrowser.selectedBrowser) + 1;
|
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 ) {
|
if ( details.index !== undefined ) {
|
||||||
tabBrowser.moveTabTo(tab, details.index);
|
tabBrowser.moveTabTo(tab, details.index);
|
||||||
@ -2683,6 +2695,12 @@ vAPI.contextMenu.unregister = function(doc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var menuitem = doc.getElementById(this.menuItemId);
|
var menuitem = doc.getElementById(this.menuItemId);
|
||||||
|
|
||||||
|
// Not guarantee the menu item was actually registered.
|
||||||
|
if ( menuitem === null ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var contextMenu = menuitem.parentNode;
|
var contextMenu = menuitem.parentNode;
|
||||||
menuitem.removeEventListener('command', this.onCommand);
|
menuitem.removeEventListener('command', this.onCommand);
|
||||||
contextMenu.removeEventListener('popupshowing', this.displayMenuItem);
|
contextMenu.removeEventListener('popupshowing', this.displayMenuItem);
|
||||||
|
@ -526,12 +526,15 @@ var gotoURL = function(ev) {
|
|||||||
|
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
|
|
||||||
|
var rel = this.getAttribute('rel') || '';
|
||||||
|
|
||||||
messager.send({
|
messager.send({
|
||||||
what: 'gotoURL',
|
what: 'gotoURL',
|
||||||
details: {
|
details: {
|
||||||
url: this.getAttribute('href'),
|
url: this.getAttribute('href'),
|
||||||
select: true,
|
select: true,
|
||||||
index: -1
|
index: -1,
|
||||||
|
popup: rel === 'popup'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<p class="statName">
|
<p class="statName">
|
||||||
<span data-i18n="popupBlockedOnThisPagePrompt"> </span> 
|
<span data-i18n="popupBlockedOnThisPagePrompt"> </span> 
|
||||||
<span id="gotoPick" class="fa tool" data-i18n-tip="popupTipPicker"></span> 
|
<span id="gotoPick" class="fa tool" data-i18n-tip="popupTipPicker"></span> 
|
||||||
<a href="logger-ui.html" target="_blank" id="gotoLog" class="fa tool enabled" data-i18n-tip="popupTipLog"></a>
|
<a href="logger-ui.html" rel="popup" class="fa tool enabled" data-i18n-tip="popupTipLog"></a>
|
||||||
</p>
|
</p>
|
||||||
<p class="statValue" id="page-blocked">?</p>
|
<p class="statValue" id="page-blocked">?</p>
|
||||||
<p class="statName" data-i18n="popupBlockedSinceInstallPrompt"> </p>
|
<p class="statName" data-i18n="popupBlockedSinceInstallPrompt"> </p>
|
||||||
|
Loading…
Reference in New Issue
Block a user