1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-02 15:47:10 +02:00

Open details pane only when clicking non-interactive elements

Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/discussions/3202
This commit is contained in:
Raymond Hill 2024-04-11 11:12:37 -04:00
parent 79543d6c32
commit 6e61a13e40
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -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();
}
);
})();