+13
-2
lines changedFilter options
+13
-2
lines changed Original file line number Diff line number Diff line change
@@ -1531,7 +1531,7 @@ export class AstFilterParser {
1531
1531
break;
1532
1532
}
1533
1533
const value = this.getNetOptionValue(NODE_TYPE_NET_OPTION_NAME_URLSKIP);
1534
-
if ( value.startsWith('?') === false || value.length < 2 ) {
1534
+
if ( value.length < 2 ) {
1535
1535
this.astError = AST_ERROR_OPTION_BADVALUE;
1536
1536
realBad = true;
1537
1537
}
Original file line number Diff line number Diff line change
@@ -5411,8 +5411,9 @@ function urlSkip(urlin, steps) {
5411
5411
try {
5412
5412
let urlout;
5413
5413
for ( const step of steps ) {
5414
+
const c0 = step.charCodeAt(0);
5414
5415
// Extract from URL parameter
5415
-
if ( step.startsWith('?') ) {
5416
+
if ( c0 === 0x3F ) { /* ? */
5416
5417
urlout = (new URL(urlin)).searchParams.get(step.slice(1));
5417
5418
if ( urlout === null ) { return; }
5418
5419
if ( urlout.includes(' ') ) {
@@ -5421,6 +5422,16 @@ function urlSkip(urlin, steps) {
5421
5422
urlin = urlout;
5422
5423
continue;
5423
5424
}
5425
+
// Extract from URL parameter name at position i
5426
+
if ( c0 === 0x26 ) { /* & */
5427
+
const i = (parseInt(step.slice(1)) || 0) - 1;
5428
+
if ( i < 0 ) { return; }
5429
+
const url = new URL(urlin);
5430
+
if ( i >= url.searchParams.size ) { return; }
5431
+
const params = Array.from(url.searchParams.keys());
5432
+
urlin = urlout = decodeURIComponent(params[i]);
5433
+
continue;
5434
+
}
5424
5435
// Enforce https
5425
5436
if ( step === '+https' ) {
5426
5437
const s = urlin.replace(/^https?:\/\//, '');
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4