Skip to content

Commit bcf5ac1

Browse files
committed
Add advanced setting to control logger popup type
Related issue: - uBlockOrigin/uBlock-issues#663 The advanced setting `loggerPopupType` has been added, to control the type of window to be used when the logger is launched as a separate window. The default value is `popup`, it can be changed to any of the values documented at: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/windows/CreateType
1 parent 5688888 commit bcf5ac1

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

platform/chromium/vapi-background.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -387,11 +387,11 @@ vAPI.Tabs = class {
387387

388388
// Properties of the details object:
389389
// - url: 'URL', => the address that will be opened
390-
// - index: -1, => undefined: end of the list, -1: following tab, or
391-
// after index
392-
// - active: false, => opens the tab in background - true and undefined:
393-
// foreground
394-
// - popup: true => open in a new window
390+
// - index: -1, => undefined: end of the list, -1: following tab,
391+
// or after index
392+
// - active: false, => opens the tab... in background: true,
393+
// foreground: undefined
394+
// - popup: 'popup' => open in a new window
395395

396396
create(url, details) {
397397
if ( details.active === undefined ) {
@@ -443,10 +443,10 @@ vAPI.Tabs = class {
443443
// For some reasons, some platforms do not honor the left,top
444444
// position when specified. I found that further calling
445445
// windows.update again with the same position _may_ help.
446-
if ( details.popup === true && browser.windows instanceof Object ) {
446+
if ( details.popup !== undefined && browser.windows instanceof Object ) {
447447
const createDetails = {
448448
url: details.url,
449-
type: 'popup',
449+
type: details.popup,
450450
};
451451
if ( details.box instanceof Object ) {
452452
Object.assign(createDetails, details.box);

src/js/background.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const µBlock = (function() { // jshint ignore:line
5252
disableWebAssembly: false,
5353
ignoreRedirectFilters: false,
5454
ignoreScriptInjectFilters: false,
55+
loggerPopupType: 'popup',
5556
manualUpdateAssetFetchPeriod: 500,
5657
popupFontSize: 'unset',
5758
requestJournalProcessPeriod: 1000,

src/js/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,8 @@
386386
!this.userSettings.alwaysDetachLogger
387387
);
388388
}
389-
details.popup = this.userSettings.alwaysDetachLogger;
390-
if ( details.popup ) {
389+
if ( this.userSettings.alwaysDetachLogger ) {
390+
details.popup = this.hiddenSettings.loggerPopupType;
391391
const url = new URL(vAPI.getURL(details.url));
392392
url.searchParams.set('popup', '1');
393393
details.url = url.href;

0 commit comments

Comments
 (0)