mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-13 01:30:37 +08:00
Feat: salvage more bad syntax from adguard
This commit is contained in:
parent
b2a1fc47e6
commit
c198e371ec
@ -292,6 +292,7 @@ const kwfilter = createKeywordFilter([
|
|||||||
'$removeparam',
|
'$removeparam',
|
||||||
'$popunder',
|
'$popunder',
|
||||||
'$cname',
|
'$cname',
|
||||||
|
'$frame',
|
||||||
// some bad syntax
|
// some bad syntax
|
||||||
'^popup'
|
'^popup'
|
||||||
]);
|
]);
|
||||||
@ -307,7 +308,7 @@ export function parse($line: string, result: [string, ParseType], allowThirdPart
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
const line = $line.trim();
|
let line = $line.trim();
|
||||||
|
|
||||||
/** @example line.length */
|
/** @example line.length */
|
||||||
const len = line.length;
|
const len = line.length;
|
||||||
@ -415,9 +416,15 @@ export function parse($line: string, result: [string, ParseType], allowThirdPart
|
|||||||
* `://o0e.ru^$third-party`
|
* `://o0e.ru^$third-party`
|
||||||
* `.1.1.1.l80.js^$third-party`
|
* `.1.1.1.l80.js^$third-party`
|
||||||
*/
|
*/
|
||||||
if (line.includes('$third-party') || line.includes('$frame')) {
|
if (line.includes('$third-party')) {
|
||||||
result[1] = ParseType.Null;
|
if (!allowThirdParty) {
|
||||||
return result;
|
result[1] = ParseType.Null;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
line = line
|
||||||
|
.replace('$third-party,', '$')
|
||||||
|
.replace('$third-party', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @example line.endsWith('^') */
|
/** @example line.endsWith('^') */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user