Skip to content

Commit

Permalink
Add ability to lock firewall height to basic pane height
Browse files Browse the repository at this point in the history
New advanced setting: `popupPanelHeightMode`.
Default value: 0

Set to 1 to force the height of the firewall pane
to be no more than the height of the basic pane.

Related feedback:
- uBlockOrigin/uBlock-issues#785 (comment)
  • Loading branch information
gorhill committed May 22, 2020
1 parent 735c2ff commit 5f4e6d8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/css/popup-fenix.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@ a {
position: relative;
}
#main {
align-self: flex-start;
max-width: 340px;
min-width: 18em;
}
:root.portrait #main {
align-self: inherit;
}
hr {
border: 0;
border-top: 1px solid #e3e2e3;
Expand Down Expand Up @@ -260,6 +264,9 @@ body[data-more=""] #lessButton {
text-align: right;
--rule-cell-width: 5em;
}
:root.desktop body.vMin #firewall {
max-height: 100vh;
}
#firewall > div {
border: 0;
direction: ltr;
Expand Down
1 change: 1 addition & 0 deletions src/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const µBlock = (( ) => { // jshint ignore:line
popupFontSize: 'unset',
popupPanelDisabledSections: 0,
popupPanelLockedSections: 0,
popupPanelHeightMode: 0,
requestJournalProcessPeriod: 1000,
selfieAfter: 3,
strictBlockingBypassDuration: 120,
Expand Down
1 change: 1 addition & 0 deletions src/js/messaging.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ const popupDataFromTabId = function(tabId, tabTitle) {
popupPanelSections: µbus.popupPanelSections,
popupPanelDisabledSections: µb.hiddenSettings.popupPanelDisabledSections,
popupPanelLockedSections: µb.hiddenSettings.popupPanelLockedSections,
popupPanelHeightMode: µb.hiddenSettings.popupPanelHeightMode,
tabId: tabId,
tabTitle: tabTitle,
tooltipsDisabled: µbus.tooltipsDisabled
Expand Down
5 changes: 5 additions & 0 deletions src/js/popup-fenix.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,11 @@ let renderOnce = function() {
if ( popupData.advancedUserEnabled !== true ) {
uDom('#firewall [title][data-src]').removeAttr('title');
}

// This must be done the firewall is populated
if ( popupData.popupPanelHeightMode === 1 ) {
body.classList.add('vMin');
}
};

/******************************************************************************/
Expand Down

0 comments on commit 5f4e6d8

Please sign in to comment.