Skip to content

Commit

Permalink
fix: do not pass since when removing localStorage in Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
dessant committed Mar 10, 2018
1 parent 3018c89 commit 4e5e500
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/background/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
showContributePage
} from 'utils/app';
import {optionKeys} from 'utils/data';
import {targetEnv} from 'utils/config';

async function clearDataType(dataType, options, enDataTypes = null) {
let {useCount} = await storage.get('useCount', 'sync');
Expand Down Expand Up @@ -61,7 +62,13 @@ async function clearDataType(dataType, options, enDataTypes = null) {
}

try {
await browser.browsingData.remove({since}, dataTypes);
if (dataTypes.localStorage && since && targetEnv === 'firefox') {
await browser.browsingData.removeLocalStorage({});
delete dataTypes.localStorage;
}
if (Object.keys(dataTypes).length) {
await browser.browsingData.remove({since}, dataTypes);
}
} catch (e) {
console.log(e);
await showNotification('error_dataTypeNotCleared');
Expand Down

0 comments on commit 4e5e500

Please sign in to comment.