set Active Rulesets
abstract suspend fun setActiveRulesets(activeRuleset: Ruleset.Type, vararg moreActiveRulesets: Ruleset.Type = emptyArray())
Sets which Rulesets are active. This method does not return until the new rules have been compiled and the filtering engine is ready. updateRulesets must be called to update the local copy of the Rulesets before this method is called for the very first time.
Parameters
active Ruleset
The Ruleset that should become active.
more Active Rulesets
The other Rulesets that should become active.
Samples
launch {
withContext(Dispatchers.IO) {
// For example, if only interested in ads and privacy blocking
client.setActiveRulesets(
Ruleset.Type.AD_BLOCKING,
Ruleset.Type.PRIVACY,
)
// Or if interested in all the rulesets
client.setActiveRulesets(allRulesets())
}
}Content copied to clipboard
Sets which Rulesets are active. This method does not return until the new rules have been compiled and the filtering engine is ready. updateRulesets must be called to update the local copy of the Rulesets before this method is called for the very first time.
Parameters
Samples
launch {
withContext(Dispatchers.IO) {
// For example, if only interested in ads and privacy blocking
client.setActiveRulesets(
Ruleset.Type.AD_BLOCKING,
Ruleset.Type.PRIVACY,
)
// Or if interested in all the rulesets
client.setActiveRulesets(allRulesets())
}
}Content copied to clipboard