From b44815f0c8f047d6efc4f3b59f4dc866af23408c Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Fri, 30 Jun 2023 11:45:34 -0400 Subject: [PATCH] Ensure no negative value for `top` property of floating widget in logger Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/2704 --- src/js/logger-ui.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js/logger-ui.js b/src/js/logger-ui.js index bd1bc496cef28..9fedb71308933 100644 --- a/src/js/logger-ui.js +++ b/src/js/logger-ui.js @@ -2044,10 +2044,13 @@ dom.on(document, 'keydown', ev => { if ( typeof response !== 'string' ) { return; } const settings = JSON.parse(response); const widget = qs$('#netInspector .entryTools'); - widget.style.bottom = settings.bottom || ''; + widget.style.bottom = ''; widget.style.left = settings.left || ''; widget.style.right = settings.right || ''; widget.style.top = settings.top || ''; + if ( /^-/.test(widget.style.top) ) { + widget.style.top = '0'; + } }); dom.on(