Add support for running snippets on specific platforms
Background
This is originally from https://issues.adblockplus.org/ticket/7451
(This is just an idea at this point.)
It has come up that filter list authors might want to deploy a snippet on one or more domains only on a specific platform. This could be done by extending the syntax of snippet filters to allow for meta arguments, like so:
example.com#$#[platform=gecko] hide-elements .ad-label
Meta arguments may even solve the problem of versioning of snippets, by letting filter list authors deploy a snippet only on a specific version or range of versions of Adblock Plus.
This could also be done using named arguments (#6812):
example.com#$#hide-elements selector=.ad-label platform=gecko
In this case, the snippet would check the value of the platform argument and decide not to run any code based on the value. Not every snippet may want to do this check, so it could be done by a wrapper similar to the function returned by makeInjector() in lib/content/snippets.js. Since named arguments would also solve other problems, this might be the more practical approach, at least for now.
What to change
TBD