Skip to content

Commit b295d4a

Browse files
committed
Make the new "fenix" popup panel the default one
The old "classic" popup panel will still be used when at least one of the following is true: - advanced setting `uiFlavor` is set to `classic`; or - the browser is Chromium 65 or older; or - the browser is Firefox 67 or older The default configuration of the new popup panel at installation time is to show the power button, statistics and the basic tool icons, i.e. access to dashboard, logger, pickers. For existing installations, the new popup panel will be configured by respecting the existing configuration of the classic one. The new popup panel is currently already in use on Firefox for Android, and the visual redesign was made according to suggestions and feedback from <https://github.com/brampitoyo> to be optimal for Firefox for Android. The new popup panel will allow closing the following pending issues: - uBlockOrigin/uBlock-issues#255 - uBlockOrigin/uBlock-issues#178
1 parent 557e06f commit b295d4a

File tree

13 files changed

+196
-104
lines changed

13 files changed

+196
-104
lines changed

platform/chromium/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"32": "img/icon_32.png"
1010
},
1111
"default_title": "uBlock Origin",
12-
"default_popup": "popup.html"
12+
"default_popup": "popup-fenix.html"
1313
},
1414
"commands": {
1515
"launch-element-zapper": {

platform/firefox/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"32": "img/icon_32.png"
1111
},
1212
"default_title": "uBlock Origin",
13-
"default_popup": "popup.html"
13+
"default_popup": "popup-fenix.html"
1414
},
1515
"browser_specific_settings": {
1616
"gecko": {

platform/opera/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"16": "img/icon_16.png",
99
"32": "img/icon_32.png"
1010
},
11-
"default_popup": "popup.html",
11+
"default_popup": "popup-fenix.html",
1212
"default_title": "uBlock Origin"
1313
},
1414
"commands": {

src/_locales/en/messages.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,11 @@
201201
},
202202
"popupMoreButton_v2":{
203203
"message":"More",
204-
"description":"Label to be used to toggle overview panel"
204+
"description":"Label to be used to show popup panel sections"
205+
},
206+
"popupLessButton_v2":{
207+
"message":"Less",
208+
"description":"Label to be used to hide popup panel sections"
205209
},
206210
"popupTipGlobalRules":{
207211
"message":"Global rules: this column is for rules which apply to all sites.",
@@ -259,6 +263,10 @@
259263
"message":"{{count}} out of {{total}}",
260264
"description":"appears in popup"
261265
},
266+
"popupVersion":{
267+
"message":"Version",
268+
"description":"Example of use: Version 1.26.4"
269+
},
262270
"pickerCreate":{
263271
"message":"Create",
264272
"description":"English: Create"

src/css/popup-fenix.css

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ hr {
5656
align-items: stretch;
5757
display: flex;
5858
justify-content: space-between;
59-
margin: var(--popup-default-gap) 0.5em;
59+
margin: 0.5em 0.5em var(--popup-default-gap) 0.5em;
6060
}
6161
#switch {
6262
display: flex;
63-
flex-grow: 2;
63+
flex-grow: 3;
6464
justify-content: center;
6565
}
6666
#switch .fa-icon {
@@ -71,10 +71,6 @@ hr {
7171
margin: 0;
7272
padding: 0;
7373
}
74-
#switch .fa-icon:hover {
75-
color: var(--popup-power-ink-hover);
76-
fill: var(--popup-power-ink-hover);
77-
}
7874
body.off #switch .fa-icon {
7975
color: var(--fg-0-20);
8076
fill: var(--fg-0-20);
@@ -85,15 +81,15 @@ body.off #switch .fa-icon {
8581
box-sizing: border-box;
8682
display: flex;
8783
flex-direction: column;
88-
flex-grow: 1;
84+
flex-grow: 2;
8985
justify-content: space-evenly;
9086
}
9187
.rulesetTools [id] {
9288
background-color: var(--bg-transient-notice);
9389
border: 1px solid #ddc;
9490
border-radius: 4px;
9591
cursor: pointer;
96-
fill: #888;
92+
fill: var(--default-ink-a50);
9793
flex-grow: 1;
9894
font-size: 2.2em;
9995
padding: 0;
@@ -177,9 +173,23 @@ body.mobile.no-tooltips .toolRibbon .tool {
177173
visibility: visible;
178174
}
179175

180-
body:not(.dfEnabled) #moreButton .fa-icon {
176+
.moreOrLess > span {
177+
cursor: pointer;
178+
}
179+
#moreButton .fa-icon {
181180
transform: rotate(180deg);
182181
}
182+
#lessButton {
183+
text-align: right;
184+
}
185+
body[data-more="a b c d e"] #moreButton {
186+
pointer-events: none;
187+
visibility: hidden;
188+
}
189+
body[data-more=""] #lessButton {
190+
pointer-events: none;
191+
visibility: hidden;
192+
}
183193

184194
#tooltip {
185195
background-color: var(--bg-tooltip);
@@ -224,9 +234,6 @@ body[dir="rtl"] #tooltip {
224234
text-align: right;
225235
--rule-cell-width: 5em;
226236
}
227-
body:not(.dfEnabled) #firewall {
228-
display: none;
229-
}
230237
#firewall > div {
231238
border: 0;
232239
direction: ltr;
@@ -246,11 +253,11 @@ body:not(.dfEnabled) #firewall {
246253
#firewall.expanded > div.isSubDomain.expandException:not(.isRootContext) {
247254
display: none;
248255
}
249-
#firewall > div > span {
256+
#firewall > div > span,
257+
#actionSelector > #dynaCounts {
250258
background-color: var(--bg-popup-cell-2);
251259
border: none;
252260
box-sizing: border-box;
253-
-moz-box-sizing: border-box;
254261
display: inline-flex;
255262
padding: 0.4em 0;
256263
position: relative;
@@ -313,7 +320,8 @@ body:not(.dfEnabled) #firewall {
313320
#firewall.expanded > div:not(.expandException) > span:nth-of-type(3),
314321
#firewall:not(.expanded) > div.expandException > span:nth-of-type(3),
315322
#firewall:not(.expanded) > div.isDomain:not(.expandException) > span:nth-of-type(4),
316-
#firewall.expanded > div.isDomain.expandException > span:nth-of-type(4) {
323+
#firewall.expanded > div.isDomain.expandException > span:nth-of-type(4),
324+
#actionSelector > #dynaCounts {
317325
display: inline-flex;
318326
justify-content: space-between;
319327
}
@@ -423,15 +431,15 @@ body.advancedUser #firewall > div > span.ownRule,
423431
color: var(--default-surface);
424432
}
425433
body.advancedUser #firewall > div > span.allowRule.ownRule,
426-
#actionSelector > #dynaAllow:hover {
434+
:root.desktop #actionSelector > #dynaAllow:hover {
427435
background-color: var(--bg-popup-cell-allow-own);
428436
}
429437
body.advancedUser #firewall > div > span.blockRule.ownRule,
430-
#actionSelector > #dynaBlock:hover {
438+
:root.desktop #actionSelector > #dynaBlock:hover {
431439
background-color: var(--bg-popup-cell-block-own);
432440
}
433441
body.advancedUser #firewall > div > span.noopRule.ownRule,
434-
#actionSelector > #dynaNoop:hover {
442+
:root.desktop #actionSelector > #dynaNoop:hover {
435443
background-color: var(--bg-popup-cell-noop-own);
436444
}
437445

@@ -458,11 +466,8 @@ body.advancedUser #firewall > div > span.noopRule.ownRule,
458466
width: 33.5%;
459467
}
460468
#actionSelector > #dynaCounts {
461-
align-items: center;
462469
background-color: transparent;
463-
display: inline-flex;
464470
height: 100%;
465-
justify-content: space-between;
466471
left: 0;
467472
pointer-events: none;
468473
position: absolute;
@@ -488,6 +493,19 @@ body.advancedUser #firewall > div > span.noopRule.ownRule,
488493
:root body[data-ui~="+no-popups"] #no-popups {
489494
display: flex;
490495
}
496+
body:not([data-more~="a"]) [data-more="a"],
497+
body:not([data-more~="b"]) [data-more="b"],
498+
body:not([data-more~="c"]) [data-more="c"],
499+
body:not([data-more~="e"]) [data-more="e"] {
500+
height: 0;
501+
margin-bottom: 0;
502+
margin-top: 0;
503+
overflow-y: hidden;
504+
visibility: hidden;
505+
}
506+
body:not([data-more~="d"]) [data-more="d"] {
507+
display: none;
508+
}
491509

492510
/* mouse-driven devices */
493511
:root.desktop {
@@ -505,6 +523,13 @@ body.advancedUser #firewall > div > span.noopRule.ownRule,
505523
max-width: 300px;
506524
width: max-content;
507525
}
526+
:root.desktop #switch .fa-icon:hover {
527+
color: var(--popup-power-ink-hover);
528+
fill: var(--popup-power-ink-hover);
529+
}
530+
:root.desktop .rulesetTools [id]:hover {
531+
fill: var(--default-ink);
532+
}
508533
:root.desktop #firewall {
509534
direction: rtl;
510535
flex-grow: 1;
@@ -513,11 +538,14 @@ body.advancedUser #firewall > div > span.noopRule.ownRule,
513538
max-height: max(100vh, 600px);
514539
min-width: 360px;
515540
overflow-y: auto;
516-
width: max-content;
541+
width: min-content;
517542
}
518543
:root.desktop .tool {
519544
padding: 0.5em;
520545
}
521546
:root.desktop .tool:hover {
522547
background-color: var(--button-surface);
523548
}
549+
:root.desktop .moreOrLess > span:hover {
550+
background-color: var(--button-surface);
551+
}

src/css/themes/default.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
--ink-50: #291d4f;
1919
--ink-80: #20123a;
2020
--ink-80-a4: #20123a0a;
21+
--ink-80-a50: #20123a88;
2122
--ink-90: #1d1133;
2223
--light-gray-10: #f9f9fb;
2324
--light-gray-30: #e0e0e6;
@@ -53,6 +54,7 @@
5354

5455
--default-ink: var(--ink-80);
5556
--default-ink-a4: var(--ink-80-a4);
57+
--default-ink-a50: var(--ink-80-a50);
5658
--default-surface: var(--light-gray-10);
5759

5860
--bg-1: hsla(240, 20%, 98%, 1);

src/js/background.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ const µBlock = (( ) => { // jshint ignore:line
9292
ignoreGenericCosmeticFilters: vAPI.webextFlavor.soup.has('mobile'),
9393
largeMediaSize: 50,
9494
parseAllABPHideFilters: true,
95+
popupPanelSections: 0b111,
96+
popupPanelDisabledSections: 0,
9597
prefetchingDisabled: true,
9698
requestLogMaxEntries: 1000,
9799
showIconBadge: true,

src/js/messaging.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,14 @@ const getFirewallRules = function(srcHostname, desHostnames) {
264264
const popupDataFromTabId = function(tabId, tabTitle) {
265265
const tabContext = µb.tabContextManager.mustLookup(tabId);
266266
const rootHostname = tabContext.rootHostname;
267+
const µbus = µb.userSettings;
267268
const r = {
268-
advancedUserEnabled: µb.userSettings.advancedUserEnabled,
269+
advancedUserEnabled: µbus.advancedUserEnabled,
269270
appName: vAPI.app.name,
270271
appVersion: vAPI.app.version,
271-
colorBlindFriendly: µb.userSettings.colorBlindFriendly,
272+
colorBlindFriendly: µbus.colorBlindFriendly,
272273
cosmeticFilteringSwitch: false,
273-
dfEnabled: µb.userSettings.dynamicFilteringEnabled,
274-
firewallPaneMinimized: µb.userSettings.firewallPaneMinimized,
274+
firewallPaneMinimized: µbus.firewallPaneMinimized,
275275
globalAllowedRequestCount: µb.localSettings.allowedRequestCount,
276276
globalBlockedRequestCount: µb.localSettings.blockedRequestCount,
277277
fontSize: µb.hiddenSettings.popupFontSize,
@@ -283,9 +283,11 @@ const popupDataFromTabId = function(tabId, tabTitle) {
283283
pageAllowedRequestCount: 0,
284284
pageBlockedRequestCount: 0,
285285
popupBlockedCount: 0,
286+
popupPanelSections: µbus.popupPanelSections,
287+
popupPanelDisabledSections: µbus.popupPanelDisabledSections,
286288
tabId: tabId,
287289
tabTitle: tabTitle,
288-
tooltipsDisabled: µb.userSettings.tooltipsDisabled
290+
tooltipsDisabled: µbus.tooltipsDisabled
289291
};
290292

291293
if ( µb.hiddenSettings.uiPopupConfig !== 'undocumented' ) {

0 commit comments

Comments
 (0)