From 8859d4352f7886b4760784fec8c5dd71dda981a2 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 16 May 2020 07:36:03 -0400 Subject: [PATCH] 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 --- src/css/popup-fenix.css | 2 +- src/js/popup-fenix.js | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/css/popup-fenix.css b/src/css/popup-fenix.css index 2b1639c6a..1c8a66947 100644 --- a/src/css/popup-fenix.css +++ b/src/css/popup-fenix.css @@ -511,7 +511,7 @@ body:not([data-more~="e"]) [data-more="e"] { } :root.desktop #main { max-width: 340px; - min-width: 290px; + width: 22em; } :root:not(.mobile) #switch:hover { background-color: var(--default-surface-hover); diff --git a/src/js/popup-fenix.js b/src/js/popup-fenix.js index 7007b6bcc..13509ef42 100644 --- a/src/js/popup-fenix.js +++ b/src/js/popup-fenix.js @@ -30,14 +30,13 @@ /******************************************************************************/ -/* -let popupFontSize; + +let popupFontSize = 'unset'; vAPI.localStorage.getItemAsync('popupFontSize').then(value => { if ( typeof value !== 'string' || value === 'unset' ) { return; } document.body.style.setProperty('font-size', value); popupFontSize = value; }); -*/ // https://github.com/chrisaljoudi/uBlock/issues/996 // Experimental: mitigate glitchy popup UI: immediately set the firewall @@ -581,7 +580,6 @@ let renderOnce = function() { const body = document.body; -/* if ( popupData.fontSize !== popupFontSize ) { popupFontSize = popupData.fontSize; if ( popupFontSize !== 'unset' ) { @@ -592,7 +590,6 @@ let renderOnce = function() { vAPI.localStorage.removeItem('popupFontSize'); } } -*/ uDom.nodeFromId('version').textContent = popupData.appVersion;