Skip to content

Commit

Permalink
feat: clear browsing data from the past 90 and 365 days
Browse files Browse the repository at this point in the history
Closes #5.
  • Loading branch information
dessant committed Mar 10, 2018
1 parent 1fe569d commit 3018c89
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 3 deletions.
20 changes: 20 additions & 0 deletions src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,16 @@
"description": "Value of the option."
},

"optionValue_clearSince_90days": {
"message": "Clear data from the past 90 days",
"description": "Value of the option."
},

"optionValue_clearSince_365days": {
"message": "Clear data from the past 365 days",
"description": "Value of the option."
},

"optionValue_clearSince_epoch": {
"message": "Clear data from the beginning of time",
"description": "Value of the option."
Expand Down Expand Up @@ -315,6 +325,16 @@
"description": "Value of the option."
},

"optionValue_clearSinceAction_90days": {
"message": "The past 90 days",
"description": "Value of the option."
},

"optionValue_clearSinceAction_365days": {
"message": "The past 365 days",
"description": "Value of the option."
},

"optionValue_clearSinceAction_epoch": {
"message": "The beginning of time",
"description": "Value of the option."
Expand Down
2 changes: 2 additions & 0 deletions src/action/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ export default {
'1day',
'1week',
'4weeks',
'90days',
'365days',
'epoch'
]
}),
Expand Down
6 changes: 6 additions & 0 deletions src/background/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ async function clearDataType(dataType, options, enDataTypes = null) {
case '4weeks':
timeDelta = 1000 * 60 * 60 * 24 * 7 * 4;
break;
case '90days':
timeDelta = 1000 * 60 * 60 * 24 * 90;
break;
case '365days':
timeDelta = 1000 * 60 * 60 * 24 * 365;
break;
}
since = new Date().getTime() - timeDelta;
}
Expand Down
12 changes: 11 additions & 1 deletion src/options/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,16 @@ export default {
selectOptions: getOptionLabels({
clearAllDataTypesAction: ['main', 'sub', 'false'],
clearSince: ['1hour', '3hours', '1day', '1week', '4weeks', 'epoch']
clearSince: [
'1hour',
'3hours',
'1day',
'1week',
'4weeks',
'90days',
'365days',
'epoch'
]
}),
options: {
Expand Down Expand Up @@ -148,6 +157,7 @@ body {
min-width: 600px;
@include mdc-typography-base;
font-size: 100%;
overflow: visible !important;
}
#app {
Expand Down
2 changes: 1 addition & 1 deletion src/storage/versions/local/xO0Hh1Vm2.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async function upgrade() {
dataTypes,
disabledDataTypes,
clearAllDataTypesAction: 'sub', // 'main', 'sub', 'false'
clearSince: 'epoch', // '1hour', '3hours', '1day', '1week', '4weeks', 'epoch'
clearSince: 'epoch', // '1hour', '3hours', '1day', '1week', '4weeks', '90days', '365days', 'epoch'
notifyOnSuccess: true
};

Expand Down
2 changes: 1 addition & 1 deletion src/storage/versions/sync/xO0Hh1Vm2.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async function upgrade() {
dataTypes,
disabledDataTypes,
clearAllDataTypesAction: 'sub', // 'main', 'sub', 'false'
clearSince: 'epoch', // '1hour', '3hours', '1day', '1week', '4weeks', 'epoch'
clearSince: 'epoch', // '1hour', '3hours', '1day', '1week', '4weeks', '90days', '365days', 'epoch'
notifyOnSuccess: true
};

Expand Down

0 comments on commit 3018c89

Please sign in to comment.