uMatrix icon indicating copy to clipboard operation
uMatrix copied to clipboard

One minor uMatrix setting is deleted with cookies

Open Okamoi opened this issue 9 years ago • 4 comments

Hi,

uMatrix on Firefox has one tiny preference that gets wiped when people clear cookies, the I want to hide all blacklisted domains from the drop down menu setting. By default domains blacklisted by filter lists or personal rules are displayed, but a simple click collapses them all into a single line.

Unfortunately, uMatrix forgets this setting when cookies are deleted. You can reproduce the loss of this setting with the CTRL+SHIFT+DEL interface where literally everything is selected. If instead you don't select cookies and offline data, then the preference will not be forgotten by uMatrix.

Would you mind sharing which API you use to store data that isn't deleted with the CTRL+SHIFT+DEL interface, while we are at it ? The developer of the Tree Tabs add-on would really benefit from knowing this, all his settings get deleted the way I described, and there can be quite a lot.

Thanks!

uMatrix 1.1.12 Firefox 57 Windows 7 64-bit

Okamoi avatar Dec 02 '17 17:12 Okamoi

Duplicate of #852. Fixed in current dev build.

Would you mind sharing which API you use to store data that isn't deleted with the CTRL+SHIFT+DEL interface

I don't know what is "CTRL+SHIFT+DEL interface".

uMatrix saves its persistent settings (those saved in the backup file) through browser.storage.local. These are never erased by the browser unless you uninstall the extension.

IndexedDB is used to save the content of the remote hosts files.

There is also window.localStorage used to persist small convenient UI settings. This is what was used to save the collapsing of the blacklisted hostnames section. That setting has now been converted to a persistent setting.

gorhill avatar Dec 02 '17 17:12 gorhill

Thanks, so I'll suggest him browser.storage.local or IndexedDB instead of anything tied to the window object.

Duplicate of #852. Fixed in current dev build.

Ah crap, sorry I did not notice it.

I don't know what is "CTRL+SHIFT+DEL interface".

I don't know how to access it without a shortcut these days. This one.

Okamoi avatar Dec 02 '17 17:12 Okamoi

I don't know what is "CTRL+SHIFT+DEL interface".

gorhill, in FF that is the "Clear All/Recent History" dialog which allows removal of various items such as cookies, various histories, Offline Website Data etc .. it is this item I bold'ed that causes the issue clearalldialog

uBo issue may be related

Apologies if this is the wrong place to bring this up, but it seems relevant to a weird issue - I think this is the same issue that @grauenwolfe was experiencing (Mac, FF57, latest uBo stable a week or so ago) where the collapsed state of the 3rd party lists in the dashboard becomes stuck - see https://github.com/ghacksuserjs/ghacks-user.js/issues/273#issuecomment-346779584 (or I will summarize below)

Dashboard set like this (collapsed) Clear Offline Website Data via various methods such as Clear All History and collapsible state is reset

The problem is that the setting is no longer and can cause a collapsed state to stick

For example, if I collapse a filter group it will stay collapsed indefinitely until OWD is cleared

Could this setting's storage location be moved? Or is this a non event and nothing needs to be done? I couldn't replicate on Windows.

Thorin-II avatar Dec 03 '17 00:12 Thorin-II

The problem is that the setting is no longer and can cause a collapsed state to to stick

I don't see how it's possible. uBO tests the stored value with === 'y', I don't see how this could ever succeed if the storage was cleared, the returned value in such case is null.

I just tried, and when I clear "Offline Website Data", uBO's window.localStorage is cleared and the UI in your screenshot is reset. Of course, forcing a reload of the "3rd-party filters" pane was necessary.

gorhill avatar Dec 03 '17 04:12 gorhill