Closed Bug 1874776 Opened 9 months ago Closed 9 months ago

Consider ignoring web extension background pages from use counter telemetry.

Categories

(Core :: DOM: Core & HTML, defect)

defect

Tracking

()

RESOLVED FIXED
123 Branch
Tracking Status
firefox123 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(4 files)

As noted by Chris in bug 1874439, we see a lot of top level pages in telemetry just in a clean profile. Debugging a little bit I saw:

moz-extension://e05ac0da-4b3f-454e-b42c-da21e4d4d5ed/_generated_background_page.html
moz-extension://48940584-81a3-482c-b28a-b2fd68a508ce/_generated_background_page.html
moz-extension://6816b494-87ca-416f-a1bb-979cf0032d78/_generated_background_page.html
moz-extension://9ad7fc62-b15f-46d2-9ebf-bd8e9171f3cf/_generated_background_page.html
moz-extension://9ec6fc95-76af-4dea-8d47-31101807fa8d/_generated_background_page.html
https://www.mozilla.org/en-US/privacy/firefox/

So web extension background pages can use web APIs, but given they're going to be mostly blank, and that they are more "in control" than regular websites, we might want to ignore those?

Just like we ignore chrome pages. This should be uncontroversial, even
though it might be the case that we don't want any of these to show up.

Not sure how to best test this...

(In reply to Emilio Cobos Álvarez (:emilio) from comment #0)

So web extension background pages can use web APIs, but given they're going to be mostly blank,

What makes you think that they are mostly blank? While functional extensions can be as simple as a few dozen lines of code, larger extensions are not uncommon.

and that they are more "in control" than regular websites, we might want to ignore those?

By "in control", do you mean that we have complete coverage of the set of public add-ons? This is true.

Nevertheless, I am not opposed to dropping extensions from use counters. The URLs (in the example above) consist of UUIDs that cannot easily be mapped back to the original extension URL.

So it seems to me comment 1 should be uncontroversial...

Though I'd lean to just ignore extension pages altogether. It doesn't seem they were measured intentionally (the code was changed in https://hg.mozilla.org/mozilla-central/rev/dc8d6a216ffa28165acaf67ddc2e88974d95a8e9#l6.19, but to preserve use counter behavior).

I don't think these are likely to bring much useful data, and I suspect they skew the data towards not using features (because pages that do nothing in their background script still get a background page, and that gets loaded every browser session).

So I propose ignoring extensions for use counters too... Wdyt? Alternatively we could stash them in a different bucket, but that seems overkill to me.

(In reply to Rob Wu [:robwu] from comment #2)

Nevertheless, I am not opposed to dropping extensions from use counters. The URLs (in the example above) consist of UUIDs that cannot easily be mapped back to the original extension URL.

(We also by design do not store the URL anyways)

Thoughts on the above?

Flags: needinfo?(smaug)
Flags: needinfo?(nika)
Flags: needinfo?(chutten)
Flags: needinfo?(bgrinstead)

Seeing as part of our intended order of work is to create a public dataset of use counters to (e.g.) give folks a look at what the shape of the web platform looks like (at least as Firefox users see it), it'd be nice to make this as close to "intuitive" to our intended audience (people who know about the web platform, but probably not the inner workings of browsers) as possible.

If we wanted a new bucket, that'd be cool (though that'd be another (at time of writing) 356 new CSS counters for page and another 356 for document, plus however many deprecated ops and so forth which isn't a small number). We could definitely handle it and keep it separate for our own uses... but until and unless someone comes up with a extension-background-page-specific use case for these counters, I think we'd best hold off.

As for continuity of data, we're only talking back to Firefox 121 for the Glean use counter metrics and Firefox 118 for Legacy Telemetry, so there's not much to preserve.

I think it's best to make the document and page counts (both the denominators and the use counters) reflect documents of web content specifically. We should remember to annotate the "use-counters" ping to note that "Prior to Firefox version <whichever it is when it lands> Document and Page use counters also included Web Extension background pages in their counts."

Or, succinctly: I think your proposed change is good.

Flags: needinfo?(chutten)

(In reply to Chris H-C :chutten from comment #5)

I think it's best to make the document and page counts (both the denominators and the use counters) reflect documents of web content specifically. We should remember to annotate the "use-counters" ping to note that "Prior to Firefox version <whichever it is when it lands> Document and Page use counters also included Web Extension background pages in their counts."

FYI: the scope is not limited to background pages only - the counters covered any moz-extension document (including extension popup panels, sidebars and actual tabs). The background pages just stood out because they are around by default.

On first blush, it seems like it might be OK to ignore extension pages for use counters, though it might still be nice to know what APIs extensions end up actually using in some cases.

For an extension though, I'm not sure that "page loads" are the correct granularity to be counting this sort of thing by anyway.

Flags: needinfo?(nika)

It seems the discussion in the bug goes in this direction, and I think
it's the right call as described there.

Depends on D198630

Ok given the comments above, I'll proceed with landing both patches, and writing a test for this.

Flags: needinfo?(smaug)
Flags: needinfo?(bgrinstead)
Severity: -- → S3

This will make testing the patches in this bug easier too.

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/80324d436ea5 Ignore built-in extension pages from telemetry. r=smaug
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/262aeaa318d3 Ignore all extension pages from use counters. r=smaug
Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 123 Branch
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/64f1b6b86676 Refactor browser_use_counters.js to avoid some duplication. r=chutten https://hg.mozilla.org/integration/autoland/rev/362d9aca9e10 Add a test for extension use counters being ignored. r=chutten
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: