Make the `compileScript` utility accept an array of scripts
Background
As discussed in https://gitlab.com/eyeo/adblockplus/adblockpluscore/-/issues/222#note_367773089, we'd like to be able to compile numerous scripts at once, as opposite of compiling each script separately, as it's currently the case.
What to change
Improve the compileScript
signature so that it can accept either a single script, backward compatible, or an array of scripts.
Integration note
As @snoack mentioned, when updating the dependency we should adapt executeScript()
and getExecutableCode()
in adblockpluschrome/lib/contentFiltering.js
to pass through an array of scripts, rather than calling those functions for each snippet separately.
However, this change, as it is, does not require those changes to work, but we need those changes to move forward with other snippets, so I'll try to land those changes in WebExt, if that's OK, so that we can hopefully move a bit faster.
edit the suggested implementation notes is here, but there are also new concerns/questions regarding this approach. Again, this MR is not strictly coupled with anything in there, but it might be not enough to solve the current status and what snippets need.