private fun MutableMap<TrackingProtectionCategory, MutableList<TrackerLog>>.addTrackerHost( category: TrackingCategory, tracker: TrackerLog, ) { val key = when (category) { TrackingCategory.CRYPTOMINING -> CRYPTOMINERS TrackingCategory.FINGERPRINTING -> FINGERPRINTERS TrackingCategory.MOZILLA_SOCIAL -> SOCIAL_MEDIA_TRACKERS TrackingCategory.SCRIPTS_AND_SUB_RESOURCES -> TRACKING_CONTENT else -> return } addTrackerHost(key, tracker) }
Add the hostname of the [TrackerLog.url] into the map for the given category from Android Components. The category is transformed into a corresponding Fenix bucket, and the item is discarded if the category doesn't have a match.