BrowserUsageTelemetry.sys.mjs (1173B)
1 /* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 // Used by nsIBrowserUsage 7 export function getUniqueDomainsVisitedInPast24Hours() { 8 // The prompting heuristic for the storage access API looks at 1% of the 9 // number of the domains visited in the past 24 hours, with a minimum cap of 10 // 5 domains, in order to prevent prompts from showing up before a tracker is 11 // about to obtain tracking power over a significant portion of the user's 12 // cross-site browsing activity (that is, we do not want to allow automatic 13 // access grants over 1% of the domains). We have the 14 // dom.storage_access.max_concurrent_auto_grants which establishes the 15 // minimum cap here (set to 5 by default) so if we return 0 here the minimum 16 // cap would always take effect. That would only become inaccurate if the 17 // user has browsed more than 500 top-level eTLD's in the past 24 hours, 18 // which should be a very unlikely scenario on mobile anyway. 19 20 return 0; 21 }