Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Avoid localStorage shim #278

Closed
dEEpProjects opened this issue Jun 1, 2023 · 6 comments
Closed

Avoid localStorage shim #278

dEEpProjects opened this issue Jun 1, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@dEEpProjects
Copy link

Hello,

I'm using the 5.8.4 version of your fantastic picker.

I have an issue when using your library in environments where localStorage is not available for security reasons.
It seems that you perform detection and shim it in case it's inaccessible. However, this has a global effect, and any other code in the same window is no longer aware of the absence of storage.

Could you perform the detection without globally modifying the window.localStorage object?

Thanks.

@joeattardi joeattardi added the bug Something isn't working label Jun 7, 2023
@joeattardi
Copy link
Owner

Thanks for letting me know about this, I didn't think of that actually. I will try to get this fixed this week.

@dEEpProjects
Copy link
Author

Hi,

Are there any updates regarding this?

@joeattardi
Copy link
Owner

Not yet, sorry. Got a lot going on right now.

@joeattardi
Copy link
Owner

Please give version 5.8.5 a try, this should be resolved now.

@dEEpProjects
Copy link
Author

dEEpProjects commented Jun 26, 2023

The picker doesn't show anymore in incognito mode.

It throws the following exception:

emojiData.ts:133 Uncaught (in promise) Error: Session storage is required to use CDN emoji data.
    at lt (emojiData.ts:133:11)
    at ie (emojiData.ts:182:12)
    at $i (createPicker.ts:15:10)
    at Module.Ri [as createPicker] (createPicker.ts:45:24)
    at VueComponent.renderPicker (emoji-picker.vue:180:42)
    at VueComponent.activated (emoji-picker.vue:283:36)
    at invokeWithErrorHandling (vue.runtime.esm.js:3017:1)
    at callHook$1 (vue.runtime.esm.js:4031:1)
    at activateChildComponent (vue.runtime.esm.js:4003:1)
    at callActivatedHooks (vue.runtime.esm.js:4171:1)

I think the fix should involve detecting the unavailability of the storage and mocking the storage in some non-global object.

@joeattardi
Copy link
Owner

Unfortunately that's out of my control. That's from a third party library I use, emojibase. When loading emoji data from the CDN, it requires the use of session storage with no way to override it.

The only way around that is to install the emojibase-data package and supply the data statically as described here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants