mirror of https://github.com/gorhill/uBlock.git
Append wildcard character only when filter starts & ends with `/`
Related issue: https://github.com/uBlockOrigin/uBlock-issues/issues/1088
This commit is contained in:
parent
65b6753c69
commit
1cb190e102
|
@ -1341,9 +1341,7 @@ dom.on(document, 'keydown', ev => {
|
|||
if ( reSchemeOnly.test(value) ) {
|
||||
value = `|${value}`;
|
||||
} else {
|
||||
if ( value.endsWith('/') ) {
|
||||
value += '*';
|
||||
} else if ( /[/?]/.test(value) === false ) {
|
||||
if ( /[/?]/.test(value) === false ) {
|
||||
value += '^';
|
||||
}
|
||||
value = `||${value}`;
|
||||
|
@ -1415,7 +1413,8 @@ dom.on(document, 'keydown', ev => {
|
|||
// Create static filter
|
||||
if ( target.id === 'createStaticFilter' ) {
|
||||
ev.stopPropagation();
|
||||
const value = staticFilterNode().value;
|
||||
const value = staticFilterNode().value
|
||||
.replace(/^((?:@@)?\/.+\/)(\$|$)/, '$1*$2');
|
||||
// Avoid duplicates
|
||||
if ( createdStaticFilters.hasOwnProperty(value) ) { return; }
|
||||
createdStaticFilters[value] = true;
|
||||
|
|
Loading…
Reference in New Issue