Remove legacy telemetry code as non functional now
This commit is contained in:
@@ -234,10 +234,6 @@ const assignManager = {
|
||||
browser.tabs.sendMessage(tabId, {
|
||||
text: `Successfully ${actionName} site to always open in this container`
|
||||
});
|
||||
backgroundLogic.sendTelemetryPayload({
|
||||
event: `${actionName}-container-assignment`,
|
||||
userContextId: userContextId,
|
||||
});
|
||||
const tab = await browser.tabs.get(tabId);
|
||||
this.calculateContextMenu(tab);
|
||||
},
|
||||
@@ -298,15 +294,7 @@ const assignManager = {
|
||||
// If the user has explicitly checked "Never Ask Again" on the warning page we will send them straight there
|
||||
if (neverAsk) {
|
||||
browser.tabs.create({url, cookieStoreId, index});
|
||||
backgroundLogic.sendTelemetryPayload({
|
||||
event: "auto-reload-page-in-container",
|
||||
userContextId: userContextId,
|
||||
});
|
||||
} else {
|
||||
backgroundLogic.sendTelemetryPayload({
|
||||
event: "prompt-to-reload-page-in-container",
|
||||
userContextId: userContextId,
|
||||
});
|
||||
let confirmUrl = `${loadPage}?url=${encodeURIComponent(url)}&cookieStoreId=${cookieStoreId}`;
|
||||
let currentCookieStoreId;
|
||||
if (currentUserContextId) {
|
||||
|
||||
@@ -26,11 +26,6 @@ const backgroundLogic = {
|
||||
},
|
||||
|
||||
async deleteContainer(userContextId) {
|
||||
this.sendTelemetryPayload({
|
||||
event: "delete-container",
|
||||
userContextId
|
||||
});
|
||||
|
||||
await this._closeTabs(userContextId);
|
||||
await browser.contextualIdentities.remove(this.cookieStoreId(userContextId));
|
||||
assignManager.deleteContainer(userContextId);
|
||||
@@ -47,15 +42,8 @@ const backgroundLogic = {
|
||||
this.cookieStoreId(options.userContextId),
|
||||
options.params
|
||||
);
|
||||
this.sendTelemetryPayload({
|
||||
event: "edit-container",
|
||||
userContextId: options.userContextId
|
||||
});
|
||||
} else {
|
||||
donePromise = browser.contextualIdentities.create(options.params);
|
||||
this.sendTelemetryPayload({
|
||||
event: "add-container"
|
||||
});
|
||||
}
|
||||
await donePromise;
|
||||
browser.runtime.sendMessage({
|
||||
@@ -67,18 +55,8 @@ const backgroundLogic = {
|
||||
let url = options.url || undefined;
|
||||
const userContextId = ("userContextId" in options) ? options.userContextId : 0;
|
||||
const active = ("nofocus" in options) ? options.nofocus : true;
|
||||
const source = ("source" in options) ? options.source : null;
|
||||
|
||||
const cookieStoreId = backgroundLogic.cookieStoreId(userContextId);
|
||||
// Only send telemetry for tabs opened by UI - i.e., not via showTabs
|
||||
if (source && userContextId) {
|
||||
this.sendTelemetryPayload({
|
||||
"event": "open-tab",
|
||||
"eventSource": source,
|
||||
"userContextId": userContextId,
|
||||
"clickedContainerTabCount": await identityState.containerTabCount(cookieStoreId)
|
||||
});
|
||||
}
|
||||
// Autofocus url bar will happen in 54: https://bugzilla.mozilla.org/show_bug.cgi?id=1295072
|
||||
|
||||
// We can't open new tab pages, so open a blank tab. Used in tab un-hide
|
||||
@@ -131,12 +109,6 @@ const backgroundLogic = {
|
||||
return null;
|
||||
}
|
||||
|
||||
this.sendTelemetryPayload({
|
||||
"event": "move-tabs-to-window",
|
||||
"userContextId": userContextId,
|
||||
"clickedContainerTabCount": identityState.containerTabCount(userContextId),
|
||||
});
|
||||
|
||||
const list = await identityState._matchTabsByContainer(options.cookieStoreId);
|
||||
|
||||
const containerState = await identityState.storageArea.get(options.cookieStoreId);
|
||||
@@ -199,13 +171,6 @@ const backgroundLogic = {
|
||||
},
|
||||
|
||||
async sortTabs() {
|
||||
const containersCounts = identityState.containersCounts();
|
||||
this.sendTelemetryPayload({
|
||||
"event": "sort-tabs",
|
||||
"shownContainersCount": containersCounts.shown,
|
||||
"totalContainerTabsCount": await identityState.totalContainerTabsCount(),
|
||||
"totalNonContainerTabsCount": await identityState.totalNonContainerTabsCount()
|
||||
});
|
||||
const windows = await browser.windows.getAll();
|
||||
for (let window of windows) { // eslint-disable-line prefer-const
|
||||
// First the pinned tabs, then the normal ones.
|
||||
@@ -267,16 +232,6 @@ const backgroundLogic = {
|
||||
return null;
|
||||
}
|
||||
|
||||
const containersCounts = identityState.containersCounts();
|
||||
this.sendTelemetryPayload({
|
||||
"event": "hide-tabs",
|
||||
"userContextId": userContextId,
|
||||
"clickedContainerTabCount": identityState.containerTabCount(userContextId),
|
||||
"shownContainersCount": containersCounts.shown,
|
||||
"hiddenContainersCount": containersCounts.hidden,
|
||||
"totalContainersCount": containersCounts.total
|
||||
});
|
||||
|
||||
const containerState = await identityState.storeHidden(options.cookieStoreId);
|
||||
await this._closeTabs(userContextId);
|
||||
return containerState;
|
||||
@@ -293,16 +248,6 @@ const backgroundLogic = {
|
||||
return null;
|
||||
}
|
||||
|
||||
const containersCounts = identityState.containersCounts();
|
||||
this.sendTelemetryPayload({
|
||||
"event": "show-tabs",
|
||||
"userContextId": userContextId,
|
||||
"clickedContainerTabCount": await identityState.containerTabCount(options.cookieStoreId),
|
||||
"shownContainersCount": containersCounts.shown,
|
||||
"hiddenContainersCount": containersCounts.hidden,
|
||||
"totalContainersCount": containersCounts.total
|
||||
});
|
||||
|
||||
const promises = [];
|
||||
|
||||
const containerState = await identityState.storageArea.get(options.cookieStoreId);
|
||||
@@ -322,16 +267,6 @@ const backgroundLogic = {
|
||||
return await identityState.storageArea.set(options.cookieStoreId, containerState);
|
||||
},
|
||||
|
||||
|
||||
sendTelemetryPayload(message = {}) {
|
||||
if (!message.event) {
|
||||
throw new Error("Missing event name for telemetry");
|
||||
}
|
||||
message.method = "sendTelemetryPayload";
|
||||
//TODO decide where this goes
|
||||
// browser.runtime.sendMessage(message);
|
||||
},
|
||||
|
||||
cookieStoreId(userContextId) {
|
||||
return `firefox-container-${userContextId}`;
|
||||
},
|
||||
|
||||
@@ -38,9 +38,6 @@ const messageHandler = {
|
||||
return assignManager._setOrRemoveAssignment(tab.id, m.url, m.userContextId, m.value);
|
||||
});
|
||||
break;
|
||||
case "sendTelemetryPayload":
|
||||
// TODO
|
||||
break;
|
||||
case "sortTabs":
|
||||
backgroundLogic.sortTabs();
|
||||
break;
|
||||
@@ -53,9 +50,6 @@ const messageHandler = {
|
||||
case "checkIncompatibleAddons":
|
||||
// TODO
|
||||
break;
|
||||
case "getShieldStudyVariation":
|
||||
// TODO
|
||||
break;
|
||||
case "moveTabsToWindow":
|
||||
response = backgroundLogic.moveTabsToWindow({
|
||||
cookieStoreId: m.cookieStoreId
|
||||
|
||||
@@ -34,20 +34,10 @@ const tabPageCounter = {
|
||||
return;
|
||||
}
|
||||
if (why === "user-closed-tab" && this.counters[tabId].tab) {
|
||||
backgroundLogic.sendTelemetryPayload({
|
||||
event: "page-requests-completed-per-tab",
|
||||
userContextId: this.counters[tabId].tab.cookieStoreId,
|
||||
pageRequestCount: this.counters[tabId].tab.pageRequests
|
||||
});
|
||||
// When we send the ping because the user closed the tab,
|
||||
// delete both the 'tab' and 'activity' counters
|
||||
delete this.counters[tabId];
|
||||
} else if (why === "user-went-idle" && this.counters[tabId].activity) {
|
||||
backgroundLogic.sendTelemetryPayload({
|
||||
event: "page-requests-completed-per-activity",
|
||||
userContextId: this.counters[tabId].activity.cookieStoreId,
|
||||
pageRequestCount: this.counters[tabId].activity.pageRequests
|
||||
});
|
||||
// When we send the ping because the user went idle,
|
||||
// only reset the 'activity' counter
|
||||
this.counters[tabId].activity = {
|
||||
|
||||
@@ -49,10 +49,6 @@ function confirmSubmit(redirectUrl, cookieStoreId) {
|
||||
pageUrl: redirectUrl
|
||||
});
|
||||
}
|
||||
browser.runtime.sendMessage({
|
||||
method: "sendTelemetryPayload",
|
||||
event: "click-to-reload-page-in-container",
|
||||
});
|
||||
openInContainer(redirectUrl, cookieStoreId);
|
||||
}
|
||||
|
||||
@@ -70,10 +66,6 @@ async function denySubmit(redirectUrl) {
|
||||
tabId: tab[0].id,
|
||||
pageUrl: redirectUrl
|
||||
});
|
||||
browser.runtime.sendMessage({
|
||||
method: "sendTelemetryPayload",
|
||||
event: "click-to-reload-page-in-same-container",
|
||||
});
|
||||
document.location.replace(redirectUrl);
|
||||
}
|
||||
|
||||
|
||||
@@ -81,11 +81,9 @@ const Logic = {
|
||||
|
||||
// Retrieve the list of identities.
|
||||
const identitiesPromise = this.refreshIdentities();
|
||||
// Get the onboarding variation
|
||||
const variationPromise = this.getShieldStudyVariation();
|
||||
|
||||
try {
|
||||
await Promise.all([identitiesPromise, variationPromise]);
|
||||
await identitiesPromise;
|
||||
} catch(e) {
|
||||
throw new Error("Failed to retrieve the identities or variation. We cannot continue. ", e.message);
|
||||
}
|
||||
@@ -158,7 +156,7 @@ const Logic = {
|
||||
};
|
||||
// Handle old style rejection with null and also Promise.reject new style
|
||||
try {
|
||||
return await browser.contextualIdentities.get(cookieStoreId) || defaultContainer;
|
||||
return await browser.contextualIdentities.get(cookieStoreId) || defaultContainer;
|
||||
} catch(e) {
|
||||
return defaultContainer;
|
||||
}
|
||||
@@ -274,14 +272,6 @@ const Logic = {
|
||||
return identity.cookieStoreId;
|
||||
},
|
||||
|
||||
sendTelemetryPayload(message = {}) {
|
||||
if (!message.event) {
|
||||
throw new Error("Missing event name for telemetry");
|
||||
}
|
||||
message.method = "sendTelemetryPayload";
|
||||
browser.runtime.sendMessage(message);
|
||||
},
|
||||
|
||||
removeIdentity(userContextId) {
|
||||
if (!userContextId) {
|
||||
return Promise.reject("removeIdentity must be called with userContextId argument.");
|
||||
@@ -317,13 +307,6 @@ const Logic = {
|
||||
});
|
||||
},
|
||||
|
||||
async getShieldStudyVariation() {
|
||||
const variation = await browser.runtime.sendMessage({
|
||||
method: "getShieldStudyVariation"
|
||||
});
|
||||
this._onboardingVariation = variation;
|
||||
},
|
||||
|
||||
generateIdentityName() {
|
||||
const defaultName = "Container #";
|
||||
const ids = [];
|
||||
@@ -474,9 +457,6 @@ Logic.registerPanel(P_CONTAINERS_LIST, {
|
||||
});
|
||||
|
||||
Logic.addEnterHandler(document.querySelector("#edit-containers-link"), () => {
|
||||
Logic.sendTelemetryPayload({
|
||||
event: "edit-containers"
|
||||
});
|
||||
Logic.showPanel(P_CONTAINERS_EDIT);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user