1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-14 23:12:28 +02:00

[scriptlet engine] Mind old scriptlet names not using .js

Related commit:
- 5552d6717d
This commit is contained in:
Raymond Hill 2019-07-09 11:36:42 -04:00
parent 5c449f59f2
commit b54522caa1
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -205,8 +205,15 @@
token = rawToken.slice(0, pos).trim();
args = rawToken.slice(pos + 1).trim();
}
// TODO: The alias lookup can be removed once scriptlet resources
// with obsolete name are converted to their new name.
if ( reng.aliases.has(token) ) {
token = reng.aliases.get(token);
} else {
token = `${token}.js`;
}
content = reng.resourceContentFromName(
`${token}.js`,
token,
'application/javascript'
);
if ( !content ) { return; }