mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-21 09:52:32 +01:00
18a84d2819
Builtin scriptlets are no longer parsed as text-based resources, they are imported as JS functions, and `toString()` is used to obtain text-based representation of a scriptlet. Scriptlet parameters are now passed as function call arguments rather than by replacing text-based occurrences of `{{i}}`. The arguments are always string values (see below for exception). Support for argument as Object has been added. This opens the door to have scriptlets using named arguments rather than positional arguments, and hence easier to extend functionality of existing scriptlets. Example: example.com##+js(scriplet, { "prop": "adblock", "value": false, "log": true }) Compatibility with user-provided scriptlets has been preserved. User-provided scriptlets can benefit some of the changes: Use the form `function(..){..}` instead of `(function(..){..})();` in order to received scriptlet arguments as part of function call -- instead of using `{{i}}`. If using the form `function(..){..}`, you can choose to receive an Object as argument -- just be sure that your scriptlet's parameter is valid JSON notation.
23 lines
409 B
Plaintext
23 lines
409 B
Plaintext
{
|
|
"browser": true,
|
|
"devel": true,
|
|
"eqeqeq": true,
|
|
"esversion": 11,
|
|
"globals": {
|
|
"chrome": false, // global variable in Chromium, Chrome, Opera
|
|
"globalThis": false,
|
|
"self": false,
|
|
"vAPI": false,
|
|
"URLSearchParams": false,
|
|
"WebAssembly": false
|
|
},
|
|
"laxbreak": true,
|
|
"newcap": false,
|
|
"nonew": false,
|
|
"strict": "global",
|
|
"sub": true,
|
|
"undef": true,
|
|
"unused": true,
|
|
"validthis": true
|
|
}
|