Open carlgieringer opened 3 years ago
That would be really useful, actually! Would you be willing to submit a PR for that?
I would say we can default to making the config leading. The keys specified in the config should reasonally be the preferences that are acceptable by the script and any alien keys in there ought to be ignored unless otherwise specified (maybe in the case of runtime-generated keys for instance).
I noticed during development that when I changed the IDs of cookies, I would get those old cookie IDs back even though I wasn't interested in them.
One way to handle this would be to provide a setting like
unrecognizedCookieIdBehavior
which could have the values (where "unrecognized cookies" means "cookies having an ID that doesn't exist in the current settings"):"include"
: includes the unrecognized cookies in.getPreferences
and in.on('update')
"ignore"
: does not include unrecognized cookies in.getPreferences
and in.on('update')
, but also doesn't delete them from the storage"remove"
: silently removes the unrecognized cookies.Here's an example of the type of workaround I had to implement since something like this functionality is missing: