From 1764dee537d1d23e51b29c4f5c46c410dead52a4 Mon Sep 17 00:00:00 2001 From: rohan Date: Wed, 23 Jun 2021 18:41:27 +0530 Subject: [PATCH] add time tracking --- README.md | 1 + docs/PRIVACY.md | 46 ++-------------------------------------------- scripts/poll.js | 4 +++- scripts/popup.js | 10 +++++----- 4 files changed, 11 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index d6d478e..531c402 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ Available on [Chrome](https://chrome.google.com/webstore/detail/snoozz-snooze-ta [Latest Release](https://github.com/rohanb10/snoozz-tab-snoozing/releases/latest/) | [Changelog](https://snoozz.me/changelog.html) | [Browser Compatibility](https://snoozz.me/compatibility.html) | [Privacy](https://snoozz.me/privacy.html) +Related repos: [Snoozz Website](https://github.com/rohanb10/snoozz-web) | [Snoozz Stats](https://github.com/rohanb10/snoozz-stats) ## Colours diff --git a/docs/PRIVACY.md b/docs/PRIVACY.md index 770b95b..6f5b45e 100644 --- a/docs/PRIVACY.md +++ b/docs/PRIVACY.md @@ -1,47 +1,5 @@ # Privacy -Snoozz has never collected, aggregated or analysed your data in any way. Not even diagnostic or crash data. +View on the Snoozz website -All your tab and window data stays on your device without any network communication. It is not uploaded anywhere. - -This extension is designed to work completely offline. Can't steal data if you're not connected to the internet. - - -## Extension Permissions - -#### alarms -- A single alarm is created (and reused) to wake up your tabs at the correct time. -- If no tabs are waking up in the next hour, the alarm is set to be triggered again in an hour. - - -#### notifications -- Send you notifications when a tab is reopened. (Not critical to use of the extension, you can turn them off at the system level) - - -#### tabs -- Used to fetch **only** the metadata from your tabs (title, url, favicon). You can review code for this in the `snoozeTab(...)` and `snoozeWindow(...)` functions in [this file](https://github.com/rohanb10/snoozz-tab-snoozing/blob/master/scripts/common.js) -- No metadata is passively recorded - it is only saved when users perform a specific action to snooze a tab or window. - - -#### storage -- Used to store snoozed tabs and windows. -- Used to store user preferences which can be configured the settings page. -- Only local storage is used for this extension. -- Old tabs are deleted periodically. You can adjust the frequency of this on the settings page (Default - 14 days after they have woken up). - - -#### contextMenu -- Used to create the Snoozz submenu in your context menu. -- Only appears when you right click on a link with a valid href attribute. -- This can be turned off on your settings page. - - -#### idle -- When the `idle` state changes to `active`, the extension will open any overdue tabs or recalculate the next alarm time. - - -#### commands -- Used to configure keyboard shortcuts on compatible browsers. Shortcuts are off by default. - - -### If you delete this extension, all your data and preferences are deleted with it. It cannot be recovered at all. I’ve tried. +[https://snoozz.me/privacy.html](https://snoozz.me/privacy.html) \ No newline at end of file diff --git a/scripts/poll.js b/scripts/poll.js index 01861ec..6608861 100644 --- a/scripts/poll.js +++ b/scripts/poll.js @@ -1,9 +1,11 @@ /* Analytics code for anonymous click data processing to a tiny server + MongoDB I created. - As you can see below, I am just sending the choice you selected. Nothing else. Not even a timestamp + As you can see below, I am just sending the choice and time you selected. Nothing else. No geographic, language, diagnostic data is collected in any way, simply the choice that you have selected in the popup + Lets say you snooze a tab to wakeup on monday morning at 9:30am, this string will be sent to the server 'monday.0930'. Thats it + All data collected using this code is fully public and can be seen at https://snoozz.me/stats.html The source code for the server is also available publicly at https://github.com/rohanb10/snoozz-stats */ diff --git a/scripts/popup.js b/scripts/popup.js index 932d64c..025fe98 100644 --- a/scripts/popup.js +++ b/scripts/popup.js @@ -314,7 +314,7 @@ async function modify(time, choice) { if (parent && parent.deleteTabFromDiv) parent.deleteTabFromDiv(getUrlParam('tabId')) var response = await editSnoozeTime(getUrlParam('tabId'), time); if (!response || !response.edited) return; - await displayPreviewAnimation(choice, 'Going back to sleep'); + await displayPreviewAnimation(choice, time.format('HHmm'), 'Going back to sleep'); if (parent && parent.closeEditModal) setTimeout(_ => parent.closeEditModal(), closeDelay); } @@ -323,7 +323,7 @@ async function snooze(time, choice) { if (isInEditMode) return modify(time, choice); var target = document.querySelector('.target.active'); if (!['tab', 'window', 'selection', 'group'].includes(target.id)) return; - + debugger; var response; if (target.id === 'tab') { response = await snoozeTab(time); @@ -334,11 +334,11 @@ async function snooze(time, choice) { } if (response && !(response.tabId || response.windowId)) return; await chrome.runtime.sendMessage(Object.assign(response, {close: true, delay: closeDelay})); - await displayPreviewAnimation(choice, `Snoozing ${target.id}`) + await displayPreviewAnimation(choice, time.format('HHmm'), `Snoozing ${target.id}`) } -async function displayPreviewAnimation(choice, text = 'Snoozing') { - await chrome.runtime.sendMessage({poll: choice.id}); +async function displayPreviewAnimation(choice, time, text = 'Snoozing') { + await chrome.runtime.sendMessage({poll: `${choice.id}.${time}`}); document.body.style.pointerEvents = 'none'; choice.classList.add('focused'); var preview = document.getElementById('preview');