Skip to content

Commit

Permalink
add time tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanb10 committed Jun 23, 2021
1 parent ee21008 commit 1764dee
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 50 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
46 changes: 2 additions & 44 deletions docs/PRIVACY.md
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 3 additions & 1 deletion scripts/poll.js
Original file line number Diff line number Diff line change
@@ -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
*/
Expand Down
10 changes: 5 additions & 5 deletions scripts/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
Expand All @@ -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');
Expand Down

0 comments on commit 1764dee

Please sign in to comment.