Restore ability to set popup panel font size in advanced settings

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/397

Issue above will require non-trivial changes, so for
now users who prefer smaller/larger popup panel can
fall back on advanced setting `popupFontSize`:

https://github.com/gorhill/uBlock/wiki/Advanced-settings#popupfontsize
This commit is contained in:
Raymond Hill 2020-05-16 07:36:03 -04:00
parent 565680e4e5
commit 8859d4352f
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 3 additions and 6 deletions

View File

@ -511,7 +511,7 @@ body:not([data-more~="e"]) [data-more="e"] {
} }
:root.desktop #main { :root.desktop #main {
max-width: 340px; max-width: 340px;
min-width: 290px; width: 22em;
} }
:root:not(.mobile) #switch:hover { :root:not(.mobile) #switch:hover {
background-color: var(--default-surface-hover); background-color: var(--default-surface-hover);

View File

@ -30,14 +30,13 @@
/******************************************************************************/ /******************************************************************************/
/*
let popupFontSize; let popupFontSize = 'unset';
vAPI.localStorage.getItemAsync('popupFontSize').then(value => { vAPI.localStorage.getItemAsync('popupFontSize').then(value => {
if ( typeof value !== 'string' || value === 'unset' ) { return; } if ( typeof value !== 'string' || value === 'unset' ) { return; }
document.body.style.setProperty('font-size', value); document.body.style.setProperty('font-size', value);
popupFontSize = value; popupFontSize = value;
}); });
*/
// https://github.com/chrisaljoudi/uBlock/issues/996 // https://github.com/chrisaljoudi/uBlock/issues/996
// Experimental: mitigate glitchy popup UI: immediately set the firewall // Experimental: mitigate glitchy popup UI: immediately set the firewall
@ -581,7 +580,6 @@ let renderOnce = function() {
const body = document.body; const body = document.body;
/*
if ( popupData.fontSize !== popupFontSize ) { if ( popupData.fontSize !== popupFontSize ) {
popupFontSize = popupData.fontSize; popupFontSize = popupData.fontSize;
if ( popupFontSize !== 'unset' ) { if ( popupFontSize !== 'unset' ) {
@ -592,7 +590,6 @@ let renderOnce = function() {
vAPI.localStorage.removeItem('popupFontSize'); vAPI.localStorage.removeItem('popupFontSize');
} }
} }
*/
uDom.nodeFromId('version').textContent = popupData.appVersion; uDom.nodeFromId('version').textContent = popupData.appVersion;