Websites commonly use local storage and indexeddb to track visitors.
While you can disable these in about:config in firefox it breaks a lot of sites (as they'd rather track you than have you be their customer).
The flush-site-data extension by mk-fg wipes all this tracking stuff out in about 20 lines of code.
You can download it on github however firefox recently removed this extension for unknown reasons and you cannot install unverified extensions.
To view the original add on page, use the wayback machine and search for https://addons.mozilla.org/en-US/firefox/addon/flush-site-data/.
It's so so simple I copied all the code here:
'use strict';
browser.browserAction.onClicked.addListener(
ev => browser.browsingData.remove({}, {
cache: true, cookies: true, localStorage: true,
indexedDB: true, serviceWorkers: true, pluginData: true })
.then(res => browser.tabs.query({}))
.then(tabs => tabs.forEach(
tab => browser.tabs.executeScript(tab.id, {code: 'sessionStorage.clear()'}) ))
.then(res => browser.notifications.create( null,
{ 'type': 'basic', 'priority': 1, 'iconUrl': 'icon.svg',
'title': 'Site data cleanup success',
'message': 'Flushed stored data and sessionStorage in all tabs' } ))
.then(note_id => new Promise(resolve => setTimeout(resolve, 2000, note_id)))
.then(note_id => browser.notifications.clear(note_id))
.catch(err => console.error('Site data cleanup FAILED', err)) )
Since FF does not let you install local addon's unless they are signed I retrived an xpi from an old FF install and copied it here flush-site-data@fraggod.net.xp.
Please verify the SHA256 and code matches 41dd0eae33830c168c529ebef1ace56c926b77a2bfb1fd575203a53194cdfd80 before using.
After seeing the issue on github I wouldn't be surprized if FF recently made the API being used here not work anymore, I've yet to test it.