Skip to content

Commit 1cb190e

Browse files
committed
Append wildcard character only when filter starts & ends with /
Related issue: uBlockOrigin/uBlock-issues#1088
1 parent 65b6753 commit 1cb190e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/js/logger-ui.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,9 +1341,7 @@ dom.on(document, 'keydown', ev => {
13411341
if ( reSchemeOnly.test(value) ) {
13421342
value = `|${value}`;
13431343
} else {
1344-
if ( value.endsWith('/') ) {
1345-
value += '*';
1346-
} else if ( /[/?]/.test(value) === false ) {
1344+
if ( /[/?]/.test(value) === false ) {
13471345
value += '^';
13481346
}
13491347
value = `||${value}`;
@@ -1415,7 +1413,8 @@ dom.on(document, 'keydown', ev => {
14151413
// Create static filter
14161414
if ( target.id === 'createStaticFilter' ) {
14171415
ev.stopPropagation();
1418-
const value = staticFilterNode().value;
1416+
const value = staticFilterNode().value
1417+
.replace(/^((?:@@)?\/.+\/)(\$|$)/, '$1*$2');
14191418
// Avoid duplicates
14201419
if ( createdStaticFilters.hasOwnProperty(value) ) { return; }
14211420
createdStaticFilters[value] = true;

0 commit comments

Comments
 (0)