Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit fc0cc70

Browse files
committed
Bug 1685213 - Part 3: Record launch method telemetry. r=bytesized
Differential Revision: https://phabricator.services.mozilla.com/D106345
1 parent b638c59 commit fc0cc70

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

browser/components/BrowserGlue.jsm

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2333,6 +2333,37 @@ BrowserGlue.prototype = {
23332333
},
23342334
},
23352335

2336+
// Report the type of shortcut used to launch
2337+
{
2338+
condition: AppConstants.platform == "win",
2339+
task: () => {
2340+
let classification;
2341+
let shortcut;
2342+
try {
2343+
shortcut = Services.appinfo.processStartupShortcut;
2344+
let shellService = Cc[
2345+
"@mozilla.org/browser/shell-service;1"
2346+
].getService(Ci.nsIWindowsShellService);
2347+
classification = shellService.classifyShortcut(shortcut);
2348+
} catch (ex) {
2349+
Cu.reportError(ex);
2350+
}
2351+
2352+
if (!classification) {
2353+
if (shortcut) {
2354+
classification = "OtherShortcut";
2355+
} else {
2356+
classification = "Other";
2357+
}
2358+
}
2359+
2360+
Services.telemetry.scalarSet(
2361+
"os.environment.launch_method",
2362+
classification
2363+
);
2364+
},
2365+
},
2366+
23362367
{
23372368
condition: AppConstants.platform == "win",
23382369
task: () => {

toolkit/components/telemetry/Scalars.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,6 +1774,27 @@ os.environment:
17741774
operating_systems:
17751775
- "windows"
17761776

1777+
launch_method:
1778+
bug_numbers:
1779+
- 1685213
1780+
description: >
1781+
Records how Firefox was started on Windows.
1782+
Currently will be one of "Desktop", "StartMenu" (including pins),
1783+
"Taskbar", "OtherShortcut", or "Other"
1784+
expires: "94"
1785+
kind: string
1786+
notification_emails:
1787+
- application-update-telemetry-alerts@mozilla.com
1788+
- agashlin@mozilla.com
1789+
- shong@mozilla.com
1790+
release_channel_collection: opt-out
1791+
products:
1792+
- firefox
1793+
record_in_processes:
1794+
- main
1795+
operating_systems:
1796+
- windows
1797+
17771798
pictureinpicture:
17781799
opened_method:
17791800
bug_numbers:

0 commit comments

Comments
 (0)