exportData is a generator function. It is wasteful to create a temporary array, pass it to the serialization function for each filter, and empty it out for the next filter in the list. Instead, the serialization function could also be a generator that yields each "line" to be serialized.

With this change, the code in exportData would look like this instead:

for (let filter of filters)
yield* filter.serialize();

What to change

Convert the serialization functions in the Filter and Subscription classes to generators, and make the corresponding changes in the exportData function.

Tips for testers

Ensure custom filters added from the options page, and the devtools panel persists between browser restarts (see hints in #6893).

Also try the following:

Subscribe to a filter list

Try a filter from the filter list, it should work

Reload the extension and try the filter again, it should work

Disable the subscription, reload the extension, and try the filter again, it should no longer work

Enable the subscription, reload the extension, and try the filter again, it should work again

Remove the subscription (click the trash icon), reload the extension, and try the filter again, it should once again no longer work