linkwarden / browser-extension

Browser extension for Linkwarden
GNU Affero General Public License v3.0
146 stars 12 forks source link

Firefox extension in InPrivate doesn't have the config #60

Closed etec-masterofsynapse closed 2 months ago

etec-masterofsynapse commented 4 months ago

Extension has been configured in regular Firefox. Open an InPrivate session and extension wants to be set up again. Run through the config again, it works for this session. Close the session and open a new one, extension wants initial config again.

crkos commented 4 months ago

Can you tell which branch are you using currently, or the one from store?.

Does this happens when using a regular session?.

crkos commented 4 months ago

The most likely thing happening is that the nature of InPrivate which doesnt store data after is closed. unless you are saying that it needs to be configured again once the session in private is closed

etec-masterofsynapse commented 4 months ago

@crkos I am running the version from the Mozilla Store. It doesn't happen in a regular session.

And yes, it wants to do the initial config everytime you open an InPrivate window, not just the first time.

crkos commented 4 months ago

I'm actually quite limited in this regard take a look at:

https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API

Since firefox implementation doesnt have chrome.storage like apis i can't do much.

This is by design, read specifically: Private Browsing / Incognito modes

etec-masterofsynapse commented 4 months ago

I'm actually quite limited in this regard take a look at:

https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API

Since firefox implementation doesnt have chrome.storage like apis i can't do much.

This is by design, read specifically: Private Browsing / Incognito modes

If this is by design, how come EVERY other extension is able to have its settings saved across InPrivate and regular? I just enable "Allow to run in InPrivate" and everything just works. This (LinkWarden) is the first extension I have this problem with.

crkos commented 4 months ago

I've read a little bit more, it seems that browser.storage.local behaves like chrome.storage, It seems that indeed i'm using the window.localStorage incorrectly, it is advised on the doc for web extension to not use this api, but the browser api. So i will just change that,

crkos commented 4 months ago

Ok i solved on: 4ea36b8

crkos commented 4 months ago

Tested on private instance of firefox

etec-masterofsynapse commented 4 months ago

@crkos Thanks, when will the version in the store be updated?

crkos commented 4 months ago

I'm waiting on Daniel to push the next version of linkwarden because it will include api keys so authentication will be less of a hassle

daniel31x13 commented 4 months ago

@etec-masterofsynapse yep, it's my fault. The next release is something big, batch editing/deletion, api keys, PWA support, sub-collections and more...

It'll probably be ready by the end of this week or early next week.

Also @crkos sorry for the delay...

crkos commented 4 months ago

It's ok actually, even if it was ready by today, I can't work on it right now, Maybe in 2-3 weeks from now im a little bit more free

crkos commented 2 months ago

Fixed on last update.