You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Adding Firefox use counter data to HTTPArchive #971
Why not? We'd need to also run tests in desktop Firefox, in addition to current desktop Chrome and Android Chrome. I don't think it's necessarily useful to collect and store everything for Firefox that is currently stored for Chrome, that would increase storage with 50%. But only use counter data seems negligible for storage.
As it stands right now, it takes ~25,000 VM's the better part of a week to collect the data. Technically it is pretty easy to support but financially it would increase the running costs by ~30% (assuming we'd only run one config). I'm guessing some form of additional sponsorship would be needed to cover the costs.
That is likely more than the value Mozilla would get from the data. 🙂
For web compat analysis, the sample_data URLs (10k pages) would still be better than nothing. Assuming a full run would be 12,500,000 URLs (httparchive.pages.2023_01_01_desktop has 12,647,566 rows), 10k pages would be 0.08% of the cost, which is .... $16.
For the purpose of this issue, using page and worker but not document makes most sense. (document is for each document, including e.g. SVGs; these accumulate into page which is per top-level page.) worker use counters don't accumulate into page so need to be included separately.
With some direction of how to implement this, and maybe with some LLM, I can take a stab at implementing this (for top rank 10k pages or so at first as a PoC).
ChatGPT's suggested approach for implementing a PoC for this issue. Does it seem correct?
Here’s a practical PoC plan that fits how HTTP Archive already handles Chrome use counters (via _blinkFeatureFirstUsed) and extends it to Firefox use counters by:
making WebPageTest/WPTAgent collect the Firefox dump, and
passing it through the existing HAR → BigQuery import path, and
(optionally) exposing it in derived tables / the site UI.
This matches the intent in the issue: get Firefox use counters into HTTP Archive, leveraging the “dump to stderr behind prefs” work in Bugzilla. (GitHub)
What already exists (so we can mirror it)
Chrome path today
WPTAgent parses Chromium trace “FeatureFirstUsed/CSSFirstUsed…” events and writes them into a JSON object, which ends up in the HAR page as _blinkFeatureFirstUsed. (GitHub)
HTTP Archive’s import step (data-pipeline/modules/import_all.py) then reads _blinkFeatureFirstUsed and converts it into the features output field. (GitHub)
Firefox enabler
Firefox now has a mechanism to dump use counters to stderr behind prefs dom.use_counters.dump.{document,worker,page}, explicitly to enable local ingestion (like HTTP Archive). (Bugzilla)
PoC approach
Goal for the PoC
For Firefox runs only, add a new HAR page field, e.g.:
_geckoUseCounters (name is up to us; choose something clearly namespaced like the blink one)
…and then teach the pipeline (or a derived query) to turn it into a usable BigQuery table.
This keeps the PoC minimally invasive: no need to redesign schemas immediately; just “get the data into the payload”.
Step 1 — Make WPTAgent collect Firefox use counters
1A) Enable Firefox prefs in the test profile
In the Firefox runner code path in wptagent (where it writes user.js / prefs), add:
dom.use_counters.dump.document = true
dom.use_counters.dump.worker = true
dom.use_counters.dump.page = true
These are the prefs introduced for this exact purpose. (GitHub)
1B) Capture stderr
Because the dump goes to stderr (Bugzilla), ensure the Firefox launch wrapper pipes stderr to a file in the test run directory (WPT already captures various logs; the PoC can just ensure we have a dedicated file like gecko_use_counters.log).
1C) Parse the dump into structured JSON
We don’t have the exact log-line format visible in the public bug view (it’s referenced via the attachment/comment), but the PoC can be robust:
Detect lines containing a recognizable prefix/token for use-counter dumps (once you run it locally you’ll see it immediately).
Extract:
scope: page vs document vs worker
url: the logged url is explicitly included to mitigate cross-process races (Bugzilla)
counter id/name and count (whatever the dump prints; likely numeric IDs)
That mirrors the idea that Firefox can dump at different scopes (document/worker/page). (Bugzilla)
1D) Inject it into the HAR page object
WPT’s HAR generator already injects extra per-page fields (that’s how _blinkFeatureFirstUsed ends up there). The PoC change is: if Firefox + parsed counters exist, set:
page["_geckoUseCounters"] = <json>
Step 2 — Pass it through HTTP Archive import
The pipeline already reads “special page fields” like _blinkFeatureFirstUsed. (GitHub)
For a PoC you have two workable options:
Option A (lowest friction): keep it in payload
Do nothing in import_all.py beyond ensuring the HAR payload already contains _geckoUseCounters. Then you can validate ingestion by querying pages.payload JSON in BigQuery.
Pros: fastest PoC
Cons: not as nice to query
Option B (still small): add a get_gecko_use_counters() helper and output a column
Add code like get_features() but for Gecko, producing either:
a new top-level field on pages like "gecko_use_counters": <json string> (similar to how other sections are JSON-stringified), or
populate the existing features array with type: "gecko" records (but that loses counts unless you extend the schema)
If you want to mirror the existing “features” output shape, note that get_features() currently converts Blink’s structure into rows with feature, type, id. (GitHub)
For Gecko, you probably want {id, count, scope, url?} — so it’s cleaner as a separate output field/table.
Once _geckoUseCounters is present (either inside payload or as its own field), create a derived query like:
firefox_use_counters table with columns:
date, client, page, rank, wptid
scope (page|document|worker)
context_url (nullable; page scope might not need it)
counter_id
count
This is the Firefox analogue to Chrome’s extracted feature-usage data (even though Chrome’s is “first used timestamp” while Firefox is “counts”). The bug discussion already acknowledges Chrome uses a trace-derived format; Firefox will be different. (Bugzilla)
Quick validation checklist (what I’d do for the PoC)
Run WPT locally with Firefox and the prefs enabled.
Confirm the stderr log contains the dump lines (and includes URLs as mentioned). (Bugzilla)
Confirm HAR log.pages[0] contains _geckoUseCounters.
Run the pipeline import locally on that HAR and confirm the JSON survives into BigQuery (payload or dedicated column).
Write a tiny SQL proof:
top 20 counter_ids by total count on a crawl date
filter by a specific URL and list counters
Notes / considerations that matter (even for PoC)
Volume / bloat risk: use counters can be large. Keep the PoC conservative:
only store non-zero counters
optionally cap to top N per scope (or store raw counts but be aware of payload size limits)
Cross-process races: Firefox’s design explicitly logs url “all the time” to mitigate races. That’s a hint you should treat the dump as append-only events that need aggregation. (Bugzilla)
Schema mismatch vs Chrome: Chrome provides “firstUsed time”; Firefox provides “counts”. Don’t try to force Gecko data into _blinkFeatureFirstUsed-like semantics.
If you want, I can sketch the exact patch points
If you tell me which harness you’re using to run Firefox in WPT (classic WPT agent vs wptagent, Docker image, etc.), I can point to the most likely files/functions to modify for:
“write prefs into profile”
“pipe stderr”
“HAR page augmentation”
But the PoC architecture above is the cleanest way to “fix” the issue request: get Firefox use counter data into HTTP Archive the same way Blink feature usage got in. (GitHub)
No, Chat GPT's approach is wrong. It looks like it planned a strategy for extracting the use counters locally in the browser as part of a crawl, not using the public dashboard dataset.
How do you get the use counter data from Firefox into the public dataset?
Extracting which use counters were hit when loading a page during crawl, and saving that into the public dataset, was my understanding of how it works for Chrome's use counters in httparchive.
How do you get the use counter data from Firefox into the public dataset?
Extracting which use counters were hit when loading a page during crawl, and saving that into the public dataset, was my understanding of how it works for Chrome's use counters in httparchive.
Sure, but that's because the HTTP Archive uses Chrome to crawl the websites. Presumably the mozilla feature usage dashboard is similar to Chrome's where it comes from telemetry reported by the browsers while they are being used but isn't collected or reported on a per-URL basis.
The implementation plan from Chat GPT and other items discussed earlier involve running a parallel crawl with Firefox to collect the data. I was under the impression that you meant to use the data from the public dashboard in some way.
If you're resurrecting the idea of running a parallel crawl, I'm happy to point you at the agent code and review any PR's to extract feature usage from the Firefox tests but I'm not signing up to manage the extra crawl infrastructure (the existing infrastructure is mostly on autopilot but I still manage it in my free time).
Yes, a parallel crawl is exactly what I had in mind.
I'm happy to point you at the agent code and review any PR's to extract feature usage from the Firefox tests
Thanks!
but I'm not signing up to manage the extra crawl infrastructure (the existing infrastructure is mostly on autopilot but I still manage it in my free time).
Understood. I can own bugs related to Firefox crawl infra.
Presumably the mozilla feature usage dashboard is similar to Chrome's where it comes from telemetry reported by the browsers while they are being used but isn't collected or reported on a per-URL basis.
The aim of the second part is identify sites that use a particular feature, rather than sites that use a particular feature in Chrome. Chrome is just the delivery mechanism to get that data rather than what we actually care about IMHO. And it was just used cause it exposed more things like this and @pmeenan 's familiarity with it. Prior to 2016 we crawled as Internet Explorer.
So the question if whether things would report different in Chrome and Firefox? I would expect most to be the same but can think of some differences. For example, if Firefox implemented something that Chrome didn't. Is that what we're looking to address here? And does that happen sufficiently often enough to warrant double crawling (even for a subset)?
I asked ChatGPT for advice again. Please correct as appropriate
The agent code @pmeenan meant is in WebPageTest.agent, now under Catchpoint:
Chrome trace use-counter parser internal/support/trace_parser.py
It filters blink.feature_usage, writes _feature_usage.json.gz, and has WriteFeatureUsage / ProcessFeatureUsageEvent. (GitHub)
Where parsed use counters are merged into page data internal/process_test.py → merge_blink_features()
It reads <prefix>_feature_usage.json.gz and stores it as page_data['blinkFeatureFirstUsed']. (GitHub)
HTTP Archive pipeline side
The issue originally points at data-pipeline/modules/import_all.py, where HTTP Archive imports that field. (GitHub)
For a Firefox PoC, the closest patch point is likely:
I don't think the technical details are the problem (though knowing where Firefox writes the use counter data to in Moz Logs or otherwise will be necessary).
To quote my earlier concerns:
I'm not signing up to manage the extra crawl infrastructure (the existing infrastructure is mostly on autopilot but I still manage it in my free time).
Finding someone to fund, host and manage a parallel crawl infrastructure with a second browser (at whatever scale is of interest), making sure it stays up to date and working with browser releases, etc is my concern.
We have a monthly meeting that would probably be a good place to discuss.
FWIW, it's not just bugs related to the crawl infra, it's the running of the actual crawl infra for it (and any associated funding). Google is currently providing the crawl infra for the Chrome-based crawling (not the HTTP Archive project itself).
Activity
rviscomi commentedon Jan 31, 2023
We only run tests in Chrome, so I don't think this would be feasible. @pmeenan WDYT?
zcorpan commentedon Jan 31, 2023
Why not? We'd need to also run tests in desktop Firefox, in addition to current desktop Chrome and Android Chrome. I don't think it's necessarily useful to collect and store everything for Firefox that is currently stored for Chrome, that would increase storage with 50%. But only use counter data seems negligible for storage.
tunetheweb commentedon Jan 31, 2023
It’s not just storage. It’s also crawl capacity.
pmeenan commentedon Jan 31, 2023
As it stands right now, it takes ~25,000 VM's the better part of a week to collect the data. Technically it is pretty easy to support but financially it would increase the running costs by ~30% (assuming we'd only run one config). I'm guessing some form of additional sponsorship would be needed to cover the costs.
zcorpan commentedon Jan 31, 2023
OK, thanks. What would that amount to in USD?
rviscomi commentedon Jan 31, 2023
30% of our current crawl expenses would come out to about $20k per month.
zcorpan commentedon Jan 31, 2023
That is likely more than the value Mozilla would get from the data. 🙂
For web compat analysis, the
sample_dataURLs (10k pages) would still be better than nothing. Assuming a full run would be 12,500,000 URLs (httparchive.pages.2023_01_01_desktophas 12,647,566 rows), 10k pages would be 0.08% of the cost, which is .... $16.Would it be feasible to start there?
zcorpan commentedon Feb 6, 2023
Update: https://bugzilla.mozilla.org/show_bug.cgi?id=1813593 is now fixed (thanks @emilio!). It's possible to set these prefs to log use counter data to
stderr:For the purpose of this issue, using
pageandworkerbut notdocumentmakes most sense. (documentis for each document, including e.g. SVGs; these accumulate intopagewhich is per top-level page.)workeruse counters don't accumulate intopageso need to be included separately.The logged output looks like this:
You need to close the page for some of the use counters to be added to the log.
max-ostapenko commentedon Jul 14, 2025
No development in the last 2 years.
Closing as outdated.
zcorpan commentedon Feb 26, 2026
There's now a public dashboard for Firefox use counters: https://mozilla.github.io/use-counters/
With some direction of how to implement this, and maybe with some LLM, I can take a stab at implementing this (for top rank 10k pages or so at first as a PoC).
max-ostapenko commentedon Feb 26, 2026
Let's do a test 💪
zcorpan commentedon Mar 5, 2026
ChatGPT's suggested approach for implementing a PoC for this issue. Does it seem correct?
pmeenan commentedon Mar 5, 2026
No, Chat GPT's approach is wrong. It looks like it planned a strategy for extracting the use counters locally in the browser as part of a crawl, not using the public dashboard dataset.
zcorpan commentedon Mar 24, 2026
How do you get the use counter data from Firefox into the public dataset?
Extracting which use counters were hit when loading a page during crawl, and saving that into the public dataset, was my understanding of how it works for Chrome's use counters in httparchive.
pmeenan commentedon Mar 24, 2026
Sure, but that's because the HTTP Archive uses Chrome to crawl the websites. Presumably the mozilla feature usage dashboard is similar to Chrome's where it comes from telemetry reported by the browsers while they are being used but isn't collected or reported on a per-URL basis.
The implementation plan from Chat GPT and other items discussed earlier involve running a parallel crawl with Firefox to collect the data. I was under the impression that you meant to use the data from the public dashboard in some way.
If you're resurrecting the idea of running a parallel crawl, I'm happy to point you at the agent code and review any PR's to extract feature usage from the Firefox tests but I'm not signing up to manage the extra crawl infrastructure (the existing infrastructure is mostly on autopilot but I still manage it in my free time).
zcorpan commentedon Apr 1, 2026
Yes, a parallel crawl is exactly what I had in mind.
Thanks!
Understood. I can own bugs related to Firefox crawl infra.
zcorpan commentedon Apr 1, 2026
For each use counter (e.g. https://chromestatus.com/metrics/feature/timeline/popularity/675 ) there are two graphs, the top one is from telemetry and the second one is from httparchive. We don't have the second graph for Firefox.
tunetheweb commentedon Apr 1, 2026
Do we need two crawls?
The aim of the second part is identify sites that use a particular feature, rather than sites that use a particular feature in Chrome. Chrome is just the delivery mechanism to get that data rather than what we actually care about IMHO. And it was just used cause it exposed more things like this and @pmeenan 's familiarity with it. Prior to 2016 we crawled as Internet Explorer.
So the question if whether things would report different in Chrome and Firefox? I would expect most to be the same but can think of some differences. For example, if Firefox implemented something that Chrome didn't. Is that what we're looking to address here? And does that happen sufficiently often enough to warrant double crawling (even for a subset)?
zcorpan commentedon Apr 1, 2026
I think there are several aspects:
Possibly there's also interest in comparing performance metrics between Chrome and Firefox.
zcorpan commentedon May 7, 2026
I asked ChatGPT for advice again. Please correct as appropriate
pmeenan commentedon May 7, 2026
I don't think the technical details are the problem (though knowing where Firefox writes the use counter data to in Moz Logs or otherwise will be necessary).
To quote my earlier concerns:
Finding someone to fund, host and manage a parallel crawl infrastructure with a second browser (at whatever scale is of interest), making sure it stays up to date and working with browser releases, etc is my concern.
zcorpan commentedon May 11, 2026
My response to that was
Maybe it's more productive to have a call?
pmeenan commentedon May 11, 2026
We have a monthly meeting that would probably be a good place to discuss.
FWIW, it's not just bugs related to the crawl infra, it's the running of the actual crawl infra for it (and any associated funding). Google is currently providing the crawl infra for the Chrome-based crawling (not the HTTP Archive project itself).
zcorpan commentedon May 11, 2026
OK. The calendar link doesn't seem to work for me. Can you invite
[email protected]please?