From c8b7d1a526d8752ca7c679feefd1e2cb64534f0b Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Fri, 22 Dec 2023 10:45:43 -0500 Subject: [PATCH] Mind drop events in filter expression field of logger Related discussion: https://github.com/uBlockOrigin/uBlock-issues/issues/3036#issuecomment-1867497436 --- CHANGELOG.md | 1 + src/js/logger-ui.js | 16 ++++++++++++++++ src/logger-ui.html | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c46a2ea45b75..423a8daa3bfa8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## Fixes / changes +- [Improve `xml-prune` scriptlet](https://github.com/gorhill/uBlock/commit/d7063a052f) - [Fix message entries overflowing in logger](https://github.com/gorhill/uBlock/commit/49c8310e22) - [Add support for `application/x-javascript` in `replace=` option](https://github.com/gorhill/uBlock/commit/abeadf18eb) - [Extend support for differential updates to imported lists](https://github.com/gorhill/uBlock/commit/443c1f81e1) diff --git a/src/js/logger-ui.js b/src/js/logger-ui.js index d61ee68f1a0ec..a43dfcd0b7974 100644 --- a/src/js/logger-ui.js +++ b/src/js/logger-ui.js @@ -2251,6 +2251,22 @@ const rowFilterer = (( ) => { dom.cl.toggle(ev.target, 'on'); builtinFilterExpression(); }); + dom.on('#filterInput > input', 'drop', ev => { + const dropItem = item => { + if ( item.kind !== 'string' ) { return false; } + item.getAsString(s => { + qs$('#filterInput > input').value = s; + parseInput(); + filterAll(); + }); + return true; + }; + for ( const item of ev.dataTransfer.items ) { + if ( dropItem(item) === false ) { continue; } + ev.preventDefault(); + break; + } + }); // https://github.com/gorhill/uBlock/issues/404 // Ensure page state is in sync with the state of its various widgets. diff --git a/src/logger-ui.html b/src/logger-ui.html index 14850e5dd9e01..33ffd24620520 100644 --- a/src/logger-ui.html +++ b/src/logger-ui.html @@ -55,7 +55,7 @@ - + angle-up