Mind drop events in filter expression field of logger

Related discussion:
https://github.com/uBlockOrigin/uBlock-issues/issues/3036#issuecomment-1867497436
This commit is contained in:
Raymond Hill 2023-12-22 10:45:43 -05:00
parent d7063a052f
commit c8b7d1a526
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
3 changed files with 18 additions and 1 deletions

View File

@ -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)

View File

@ -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.

View File

@ -55,7 +55,7 @@
<span id="filterExprGroup">
<button id="filterButton" class="iconified notext" data-i18n-title="loggerRowFiltererButtonTip"><span class="fa-icon">filter</span><span class="hover"></span></button>
<span id="filterInput">
<input type="search" placeholder="logFilterPrompt">
<input type="search" placeholder="logFilterPrompt" spellcheck="false">
<span id="filterExprButton" class="button fa-icon expanded" data-i18n-title="loggerRowFiltererBuiltinTip">angle-up</span>
<div id="filterExprPicker">
<div><span data-filtex="!" data-i18n="loggerRowFiltererBuiltinNot"></span><span data-filtex="\t--\t|\t<<\t|\t##" data-i18n="loggerRowFiltererBuiltinBlocked"></span><span data-filtex="\t\+\+\t|\t\*\*\t|\t#@#" data-i18n="loggerRowFiltererBuiltinAllowed"></span><span data-filtex="[$,](?:csp|permissions|removeparam|redirect-rule|replace|urltransform)=|\t\<\<\t" data-i18n="loggerRowFiltererBuiltinModified"></span></div>