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

Commit 5b94d26

Browse files
committed
Remove tabid from packageLogs
1 parent 4ede28c commit 5b94d26

File tree

1 file changed

+3
-29
lines changed

1 file changed

+3
-29
lines changed

src/packageLogs.js

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export let filterHandler = null;
3333
export let mapHandler = null;
3434
export let cbHandlers = {};
3535

36-
3736
/**
3837
* Assigns a handler to filter logs out of the queue.
3938
* @deprecated Use addCallbacks and removeCallbacks instead
@@ -105,29 +104,13 @@ export function initPackager(newLogs, newConfig) {
105104
intervalLog = null;
106105
}
107106

108-
/**
109-
* Get the tabID from local storage
110-
*/
111-
export function getTabId() {
112-
const api = (typeof browser !== 'undefined') ? browser : chrome;
113-
return new Promise((resolve, reject) => {
114-
api.storage.local.get("tabId", function(result) {
115-
if (result.tabId !== undefined) {
116-
resolve(result.tabId);
117-
} else {
118-
reject('tabId not found');
119-
}
120-
});
121-
});
122-
}
123-
124107
/**
125108
* Transforms the provided HTML event into a log and appends it to the log queue.
126109
* @param {Object} e The event to be logged.
127110
* @param {Function} detailFcn The function to extract additional log parameters from the event.
128111
* @return {boolean} Whether the event was logged.
129112
*/
130-
export async function packageLog(e, detailFcn) {
113+
export function packageLog(e, detailFcn) {
131114
if (!config.on) {
132115
return false;
133116
}
@@ -141,8 +124,6 @@ export async function packageLog(e, detailFcn) {
141124
(e.timeStamp && e.timeStamp > 0) ? config.time(e.timeStamp) : Date.now()
142125
);
143126

144-
const tabId = await getTabId();
145-
146127
let log = {
147128
'target' : getSelector(e.target),
148129
'path' : buildPath(e),
@@ -162,7 +143,6 @@ export async function packageLog(e, detailFcn) {
162143
'toolVersion' : config.version,
163144
'toolName' : config.toolName,
164145
'useraleVersion': config.useraleVersion,
165-
'tabId': tabId,
166146
'sessionID': config.sessionID,
167147
};
168148

@@ -194,7 +174,7 @@ export async function packageLog(e, detailFcn) {
194174
* @param {boolean} userAction Indicates user behavior (true) or system behavior (false)
195175
* @return {boolean} Whether the event was logged.
196176
*/
197-
export async function packageCustomLog(customLog, detailFcn, userAction) {
177+
export function packageCustomLog(customLog, detailFcn, userAction) {
198178
if (!config.on) {
199179
return false;
200180
}
@@ -204,8 +184,6 @@ export async function packageCustomLog(customLog, detailFcn, userAction) {
204184
details = detailFcn();
205185
}
206186

207-
const tabId = await getTabId();
208-
209187
const metaData = {
210188
'pageUrl': window.location.href,
211189
'pageTitle': document.title,
@@ -220,7 +198,6 @@ export async function packageCustomLog(customLog, detailFcn, userAction) {
220198
'toolVersion' : config.version,
221199
'toolName' : config.toolName,
222200
'useraleVersion': config.useraleVersion,
223-
'tabId': tabId,
224201
'sessionID': config.sessionID
225202
};
226203

@@ -266,7 +243,7 @@ export function extractTimeFields(timeStamp) {
266243
* @param {Object} e
267244
* @return boolean
268245
*/
269-
export async function packageIntervalLog(e) {
246+
export function packageIntervalLog(e) {
270247
const target = getSelector(e.target);
271248
const path = buildPath(e);
272249
const type = e.type;
@@ -281,8 +258,6 @@ export async function packageIntervalLog(e) {
281258
intervalCounter = 0;
282259
}
283260

284-
const tabId = await getTabId();
285-
286261
if (intervalID !== target || intervalType !== type) {
287262
// When to create log? On transition end
288263
// @todo Possible for intervalLog to not be pushed in the event the interval never ends...
@@ -307,7 +282,6 @@ export async function packageIntervalLog(e) {
307282
'toolVersion': config.version,
308283
'toolName': config.toolName,
309284
'useraleVersion': config.useraleVersion,
310-
'tabId': tabId,
311285
'sessionID': config.sessionID
312286
};
313287

0 commit comments

Comments
 (0)