Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] An option to automatically add location.pathname to keys #243

Open
xiety opened this issue Apr 6, 2024 · 0 comments
Open
Labels
Feature Request Request to add a new feature Triage Issue needs to be triaged

Comments

@xiety
Copy link

xiety commented Apr 6, 2024

When hosting Blazor Wasm on Github Pages, all my repositories have the same origin. So localStorage items are shared among all my repositories.

So, I want an option to prefix every key with the current location.pathname

Workaround is to patch JS methods like in this example:

https://github.com/TomasHubelbauer/github-pages-local-storage/blob/main/index.js

localStorage.constructor.prototype.getItem = (key) => getItem.apply(localStorage, [location.pathname + ':' + key]);

Or manually add prefixes to all method calls.

@xiety xiety added Feature Request Request to add a new feature Triage Issue needs to be triaged labels Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Request to add a new feature Triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant