Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information