From 6e61a13e4065ed327978697afaa1d21de352675c Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 11 Apr 2024 11:12:37 -0400 Subject: [PATCH] Open details pane only when clicking non-interactive elements Related feedback: https://github.com/uBlockOrigin/uBlock-issues/discussions/3202 --- src/js/logger-ui.js | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/js/logger-ui.js b/src/js/logger-ui.js index f7752a052..c3c293566 100644 --- a/src/js/logger-ui.js +++ b/src/js/logger-ui.js @@ -1947,13 +1947,13 @@ dom.on(document, 'keydown', ev => { // interpreted as a request to open the details of the entry. let selectionAtMouseDown; let selectionAtTimer; - dom.on('#netInspector', 'mousedown', '.canDetails *', ev => { + dom.on('#netInspector', 'mousedown', '.canDetails *:not(a)', ev => { if ( ev.button !== 0 ) { return; } if ( selectionAtMouseDown !== undefined ) { return; } selectionAtMouseDown = document.getSelection().toString(); }); - dom.on('#netInspector', 'click', '.canDetails *', ev => { + dom.on('#netInspector', 'click', '.canDetails *:not(a)', ev => { if ( ev.button !== 0 ) { return; } if ( selectionAtTimer !== undefined ) { clearTimeout(selectionAtTimer); @@ -1968,21 +1968,17 @@ dom.on(document, 'keydown', ev => { }, 333); }); - dom.on( - '#netInspector', - 'click', - '.logEntry > div > span:nth-of-type(8) a', - ev => { - vAPI.messaging.send('codeViewer', { - what: 'gotoURL', - details: { - url: ev.target.getAttribute('href'), - select: true, - }, - }); - ev.preventDefault(); - ev.stopPropagation(); - } + dom.on('#netInspector', 'click', '.logEntry > div > span:nth-of-type(8) a', ev => { + vAPI.messaging.send('codeViewer', { + what: 'gotoURL', + details: { + url: ev.target.getAttribute('href'), + select: true, + }, + }); + ev.preventDefault(); + ev.stopPropagation(); + } ); })();