Bug 1817203: Introduce go_button in engagement_type r=mak

Differential Revision: https://phabricator.services.mozilla.com/D171033
This commit is contained in:
Daisuke Akatsuka
2023-02-28 01:26:49 +00:00
parent b4d694fef0
commit 95dabb81e9
3 changed files with 19 additions and 2 deletions

View File

@@ -944,8 +944,10 @@ class TelemetryEvent {
startEventInfo.interactionType == "dropped" ? "drop_go" : "paste_go";
} else if (event.type == "blur") {
action = "blur";
} else if (MouseEvent.isInstance(event)) {
action = event.target.id == "urlbar-go-button" ? "go_button" : "click";
} else {
action = MouseEvent.isInstance(event) ? "click" : "enter";
action = "enter";
}
let method = action == "blur" ? "abandonment" : "engagement";
@@ -982,6 +984,11 @@ class TelemetryEvent {
return;
}
if (action == "go_button") {
// Fall back since the conventional telemetry dones't support "go_button" action.
action = "click";
}
let endTime = (event && event.timeStamp) || Cu.now();
let startTime = startEventInfo.timeStamp || endTime;
// Synthesized events in tests may have a bogus timeStamp, causing a