Web Technologies Polyfill
Palefill internally uses a rule system inspired by Adblock to specify what rules are applied to sites. This allows adding new fixes by writing very little code.
Rules are made up of two parts: at least one selector and at least one fix.
Fixes can be any number of actions, best refer to function evaluateFix for up-to-date info on what each one does. The names are case-sensitive.
Selectors use a syntax derieved from Adblock filters. Three parts are used:
*
wildcard can be used at the leftmost level to match any (recursive) subdomain*
wildcard can be used anywhere in the path (also at the start and end)All of these are valid selectors:
example.com
example.com/path/a.html
*.example.com/path/to.js$script
example.com/path/any*.js$script
example.com/static-*/app-*.js$script
example.com$subdocument
Rule scripts are constructed by giving any number of selectors followed by a comma-separated list of the fixes to apply, indented by whitespace:
example.com
example.com/path/a.html
std-queueMicrotask,std-customElements
Additionally, the exclusion script has a special case: if the special fix *
is used, all fixes are
suppressed for the matched sites. This is useful when running this add-on alongside others that also
apply changes. For example, the following rule disables all fixes on github.com
:
github.com
*
Since there are many self-hosted GitLab instances that all need the same fixes as the “official” gitlab.com
,
a split approach is used for these: a list of well-known instances is shipped with the add-on and additionally,
it is possible to specify custom URLs in the add-on’s preferences. This makes it easy to i.e. add private instances
that don’t need to be in the global list.