Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // To be ran in chrome://settings/siteData
- (await cr.sendWithPromise('localData.getDisplayList', ''))
- .items
- .filter(
- r => r.site &&
- !r.site.match(/wikipedia|twitch|youtube|amazon|google|spotify|github\.com/) &&
- r.localData.match(/(Cache|Local|Database) storage/ig)
- )
- .forEach(async row => {
- (await cr.sendWithPromise('localData.getCookieDetails', row.site))
- .children
- .filter(r =>
- r.idPath && r.idPath.match(/^\d+,\d+,\d+$/) &&
- r.size && !r.size.endsWith(' B') &&
- ['local_storage', 'indexed_db', 'cache_storage'].includes(r.type)
- )
- .forEach(_storage => {
- let { origin, type, modified, size, idPath } = _storage
- size = (size.endsWith('MB') ? 1 : 0.001) * +size.replace(/[BKM ,]/g, '')
- modified = (modified || (new Date()).toLocaleString()).replace(/at (.*)$/, '')
- let days_ago = Math.floor((Date.now() - new Date(modified)) / (864e5))
- if (size > 0.2 || days_ago > 30) {
- console.log({ size: Intl.NumberFormat().format(size) + ' MB', type, days_ago, modified, origin })
- chrome.send("localData.removeCookie", [idPath])
- }
- })
- })
Add Comment
Please, Sign In to add comment