Skip to content

Commit

Permalink
Revert "Google Analytics"
Browse files Browse the repository at this point in the history
This reverts commit 5901445.
  • Loading branch information
pgarrison committed Jan 3, 2024
1 parent 920942e commit 96c80bf
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 76 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
Chrome extension for autofilling Allen Institute time cards.
With a single click, you can fill out a time card with a single time code for 8 hours M-F.

## Privacy and user data
This extension sends a minimal amount of data to Google Analytics to count how many people use it.

## Installation
Currently only Chrome is supported.

Expand Down
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
"build": "webpack --config webpack.config.js",
"test": "jest"
},
"devDependencies": {
"dependencies": {
"@types/chrome": "^0.0.254",
"@types/jest": "^29.5.11",
"@types/uuid": "^9",
"copy-webpack-plugin": "^11.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
Expand All @@ -17,8 +16,5 @@
"typescript": "^5.3.3",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4"
},
"dependencies": {
"uuid": "^9.0.1"
}
}
38 changes: 0 additions & 38 deletions src/analytics/analytics.ts

This file was deleted.

9 changes: 2 additions & 7 deletions src/content-script.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { SupportQuery, Supported, TimeCardOptionsMessage } from './time-card'
import fillOutForm from './content-script/fill-form'
import { navigateToAddTimeCard, isSupportedPage } from './content-script/navigate-to-time-cards'
import { sendError } from './analytics/analytics';

async function navigateAndFill(request: TimeCardOptionsMessage) {
await navigateToAddTimeCard();
return fillOutForm(request);
}

chrome.runtime.onMessage.addListener(
async function(request: TimeCardOptionsMessage | SupportQuery, _, sendResponse) {
Expand All @@ -17,7 +11,8 @@ chrome.runtime.onMessage.addListener(
console.log('Time sheet autofiller activated on unsupported page.');
return;
}
navigateAndFill(request).catch(sendError);
await navigateToAddTimeCard();
fillOutForm(request);
}
}
);
Expand Down
2 changes: 0 additions & 2 deletions src/content-script/fill-form.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { sendError, sendEvents } from '../analytics/analytics';
import { TimeCardOptions } from '../time-card'
import { waitForElms, findOne, xpathSnapshotToArray } from './domQuery';
import getWeekdayCells from './get-weekday-cells';
Expand Down Expand Up @@ -62,5 +61,4 @@ export default async function fillOutForm(request: TimeCardOptions) {
enabledWeekdays.forEach(el => el.click());
(await findOne('img[title="Close"]')).click();
(await findOne('//a[span="OK"]', true)).click();
sendEvents([{ type: "success" }])
}
4 changes: 1 addition & 3 deletions src/service-worker.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { SupportQuery, Supported, TimeCardOptions, TimeCardOptionsMessage } from './time-card'
import { sendEvents, sendError } from './analytics/analytics';

function setSupported(isSupported: boolean) {
const icon = isSupported ? 'icons/icon16.png' : 'icons/gray16.png';
Expand All @@ -22,9 +21,8 @@ chrome.runtime.onMessage.addListener((message: Supported) => {
});

chrome.action.onClicked.addListener((tab) => {
sendEvents([{ type: "activated" }]);
chrome.storage.sync.get().then((settings: TimeCardOptions) => {
const options: TimeCardOptionsMessage = { messageType: 'click', ...settings };
chrome.tabs.sendMessage(tab.id, options);
}).catch(sendError);
});
});
18 changes: 0 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1005,13 +1005,6 @@ __metadata:
languageName: node
linkType: hard

"@types/uuid@npm:^9":
version: 9.0.7
resolution: "@types/uuid@npm:9.0.7"
checksum: b329ebd4f9d1d8e08d4f2cc211be4922d70d1149f73d5772630e4a3acfb5170c6d37b3d7a39a0412f1a56e86e8a844c7f297c798b082f90380608bf766688787
languageName: node
linkType: hard

"@types/yargs-parser@npm:*":
version: 21.0.3
resolution: "@types/yargs-parser@npm:21.0.3"
Expand Down Expand Up @@ -3795,14 +3788,12 @@ __metadata:
dependencies:
"@types/chrome": "npm:^0.0.254"
"@types/jest": "npm:^29.5.11"
"@types/uuid": "npm:^9"
copy-webpack-plugin: "npm:^11.0.0"
jest: "npm:^29.7.0"
jest-environment-jsdom: "npm:^29.7.0"
ts-jest: "npm:^29.1.1"
ts-loader: "npm:^9.5.1"
typescript: "npm:^5.3.3"
uuid: "npm:^9.0.1"
webpack: "npm:^5.89.0"
webpack-cli: "npm:^5.1.4"
languageName: unknown
Expand Down Expand Up @@ -4732,15 +4723,6 @@ __metadata:
languageName: node
linkType: hard

"uuid@npm:^9.0.1":
version: 9.0.1
resolution: "uuid@npm:9.0.1"
bin:
uuid: dist/bin/uuid
checksum: 1607dd32ac7fc22f2d8f77051e6a64845c9bce5cd3dd8aa0070c074ec73e666a1f63c7b4e0f4bf2bc8b9d59dc85a15e17807446d9d2b17c8485fbc2147b27f9b
languageName: node
linkType: hard

"v8-to-istanbul@npm:^9.0.1":
version: 9.2.0
resolution: "v8-to-istanbul@npm:9.2.0"
Expand Down

0 comments on commit 96c80bf

Please sign in to comment.