mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Rename urltransform to uritransform
Related commit: https://github.com/uBlockOrigin/uAssets/commit/20312c2178 To work around incompatibity with `urltransform` in 1.53.0. With this commit support for `urltransform` is dropped in favor of `uritransform`. Since `uritransform` won't be parsed by older versions of uBO, the change in syntax for `urltransform` between 1.53.0 and 1.54.0 will no longer cause issue.
This commit is contained in:
parent
01ce24eea2
commit
cdc5e89f52
2 changed files with 9 additions and 9 deletions
|
|
@ -273,7 +273,7 @@ export const nodeTypeFromOptionName = new Map([
|
||||||
[ 'shide', NODE_TYPE_NET_OPTION_NAME_SHIDE ],
|
[ 'shide', NODE_TYPE_NET_OPTION_NAME_SHIDE ],
|
||||||
/* synonym */ [ 'specifichide', NODE_TYPE_NET_OPTION_NAME_SHIDE ],
|
/* synonym */ [ 'specifichide', NODE_TYPE_NET_OPTION_NAME_SHIDE ],
|
||||||
[ 'to', NODE_TYPE_NET_OPTION_NAME_TO ],
|
[ 'to', NODE_TYPE_NET_OPTION_NAME_TO ],
|
||||||
[ 'urltransform', NODE_TYPE_NET_OPTION_NAME_URLTRANSFORM ],
|
[ 'uritransform', NODE_TYPE_NET_OPTION_NAME_URLTRANSFORM ],
|
||||||
[ 'xhr', NODE_TYPE_NET_OPTION_NAME_XHR ],
|
[ 'xhr', NODE_TYPE_NET_OPTION_NAME_XHR ],
|
||||||
/* synonym */ [ 'xmlhttprequest', NODE_TYPE_NET_OPTION_NAME_XHR ],
|
/* synonym */ [ 'xmlhttprequest', NODE_TYPE_NET_OPTION_NAME_XHR ],
|
||||||
[ 'webrtc', NODE_TYPE_NET_OPTION_NAME_WEBRTC ],
|
[ 'webrtc', NODE_TYPE_NET_OPTION_NAME_WEBRTC ],
|
||||||
|
|
@ -3081,7 +3081,7 @@ export const netOptionTokenDescriptors = new Map([
|
||||||
[ 'shide', { } ],
|
[ 'shide', { } ],
|
||||||
/* synonym */ [ 'specifichide', { } ],
|
/* synonym */ [ 'specifichide', { } ],
|
||||||
[ 'to', { mustAssign: true } ],
|
[ 'to', { mustAssign: true } ],
|
||||||
[ 'urltransform', { mustAssign: true } ],
|
[ 'uritransform', { mustAssign: true } ],
|
||||||
[ 'xhr', { canNegate: true } ],
|
[ 'xhr', { canNegate: true } ],
|
||||||
/* synonym */ [ 'xmlhttprequest', { canNegate: true } ],
|
/* synonym */ [ 'xmlhttprequest', { canNegate: true } ],
|
||||||
[ 'webrtc', { } ],
|
[ 'webrtc', { } ],
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ const keyvalStore = typeof vAPI !== 'undefined'
|
||||||
// ||||+---------------- bit 12: removeparam filters
|
// ||||+---------------- bit 12: removeparam filters
|
||||||
// |||+----------------- bit 13: csp filters
|
// |||+----------------- bit 13: csp filters
|
||||||
// ||+------------------ bit 14: permissions filters
|
// ||+------------------ bit 14: permissions filters
|
||||||
// |+------------------- bit 15: urltransform filters
|
// |+------------------- bit 15: uritransform filters
|
||||||
// +-------------------- bit 16: replace filters
|
// +-------------------- bit 16: replace filters
|
||||||
// TODO: bit 11-16 can be converted into 3-bit value, as these options are not
|
// TODO: bit 11-16 can be converted into 3-bit value, as these options are not
|
||||||
// meant to be combined.
|
// meant to be combined.
|
||||||
|
|
@ -217,7 +217,7 @@ const modifierTypeFromName = new Map([
|
||||||
[ 'removeparam', MODIFIER_TYPE_REMOVEPARAM ],
|
[ 'removeparam', MODIFIER_TYPE_REMOVEPARAM ],
|
||||||
[ 'csp', MODIFIER_TYPE_CSP ],
|
[ 'csp', MODIFIER_TYPE_CSP ],
|
||||||
[ 'permissions', MODIFIER_TYPE_PERMISSIONS ],
|
[ 'permissions', MODIFIER_TYPE_PERMISSIONS ],
|
||||||
[ 'urltransform', MODIFIER_TYPE_URLTRANSFORM ],
|
[ 'uritransform', MODIFIER_TYPE_URLTRANSFORM ],
|
||||||
[ 'replace', MODIFIER_TYPE_REPLACE ],
|
[ 'replace', MODIFIER_TYPE_REPLACE ],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
@ -227,7 +227,7 @@ const modifierNameFromType = new Map([
|
||||||
[ MODIFIER_TYPE_REMOVEPARAM, 'removeparam' ],
|
[ MODIFIER_TYPE_REMOVEPARAM, 'removeparam' ],
|
||||||
[ MODIFIER_TYPE_CSP, 'csp' ],
|
[ MODIFIER_TYPE_CSP, 'csp' ],
|
||||||
[ MODIFIER_TYPE_PERMISSIONS, 'permissions' ],
|
[ MODIFIER_TYPE_PERMISSIONS, 'permissions' ],
|
||||||
[ MODIFIER_TYPE_URLTRANSFORM, 'urltransform' ],
|
[ MODIFIER_TYPE_URLTRANSFORM, 'uritransform' ],
|
||||||
[ MODIFIER_TYPE_REPLACE, 'replace' ],
|
[ MODIFIER_TYPE_REPLACE, 'replace' ],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
@ -4378,7 +4378,7 @@ FilterContainer.prototype.dnrFromCompiled = function(op, context, ...args) {
|
||||||
[ REMOVEPARAM_REALM, 'removeparam' ],
|
[ REMOVEPARAM_REALM, 'removeparam' ],
|
||||||
[ CSP_REALM, 'csp' ],
|
[ CSP_REALM, 'csp' ],
|
||||||
[ PERMISSIONS_REALM, 'permissions' ],
|
[ PERMISSIONS_REALM, 'permissions' ],
|
||||||
[ URLTRANSFORM_REALM, 'urltransform' ],
|
[ URLTRANSFORM_REALM, 'uritransform' ],
|
||||||
]);
|
]);
|
||||||
const partyness = new Map([
|
const partyness = new Map([
|
||||||
[ ANYPARTY_REALM, '' ],
|
[ ANYPARTY_REALM, '' ],
|
||||||
|
|
@ -4570,7 +4570,7 @@ FilterContainer.prototype.dnrFromCompiled = function(op, context, ...args) {
|
||||||
dnrAddRuleError(rule, `Unsupported removeparam exception: ${rule.__modifierValue}`);
|
dnrAddRuleError(rule, `Unsupported removeparam exception: ${rule.__modifierValue}`);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'urltransform': {
|
case 'uritransform': {
|
||||||
const path = rule.__modifierValue;
|
const path = rule.__modifierValue;
|
||||||
let priority = rule.priority || 1;
|
let priority = rule.priority || 1;
|
||||||
if ( rule.__modifierAction !== ALLOW_REALM ) {
|
if ( rule.__modifierAction !== ALLOW_REALM ) {
|
||||||
|
|
@ -5297,7 +5297,7 @@ FilterContainer.prototype.redirectRequest = function(redirectEngine, fctxt) {
|
||||||
};
|
};
|
||||||
|
|
||||||
FilterContainer.prototype.transformRequest = function(fctxt) {
|
FilterContainer.prototype.transformRequest = function(fctxt) {
|
||||||
const directives = this.matchAndFetchModifiers(fctxt, 'urltransform');
|
const directives = this.matchAndFetchModifiers(fctxt, 'uritransform');
|
||||||
if ( directives === undefined ) { return; }
|
if ( directives === undefined ) { return; }
|
||||||
const directive = directives[directives.length-1];
|
const directive = directives[directives.length-1];
|
||||||
if ( (directive.bits & ALLOW_REALM) !== 0 ) { return directives; }
|
if ( (directive.bits & ALLOW_REALM) !== 0 ) { return directives; }
|
||||||
|
|
@ -5584,7 +5584,7 @@ FilterContainer.prototype.dump = function() {
|
||||||
[ REMOVEPARAM_REALM, 'removeparam' ],
|
[ REMOVEPARAM_REALM, 'removeparam' ],
|
||||||
[ CSP_REALM, 'csp' ],
|
[ CSP_REALM, 'csp' ],
|
||||||
[ PERMISSIONS_REALM, 'permissions' ],
|
[ PERMISSIONS_REALM, 'permissions' ],
|
||||||
[ URLTRANSFORM_REALM, 'urltransform' ],
|
[ URLTRANSFORM_REALM, 'uritransform' ],
|
||||||
[ REPLACE_REALM, 'replace' ],
|
[ REPLACE_REALM, 'replace' ],
|
||||||
]);
|
]);
|
||||||
const partyness = new Map([
|
const partyness = new Map([
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue