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

Suggestion: use localForage and/or LZ-string for storing larger notes #2

Open
JobLeonard opened this issue Jul 11, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@JobLeonard
Copy link

The code makes use of localStorage() to save the raw text and the time and date of when the edit has been made.

Given that localStorage only has 5MiB available to it, you might want to use the localForage library to have a localStorage-like API for IndexedDB, with automatic localForage fallback, so that people can store even larger notes, or you could even support storing pasted images as PNG blobs.

Alternatively, you might want to either compress the text with LZ-String before storing it. (BTW, version 2.0 is currently awaiting a merge and much faster, especially if you use the "Unsafe" version)

@fiveNinePlusR
Copy link

A better option that doesn't require any external dependencies is to use the unlimitedStorage permission which just uses the same API but doesn't limit the storage. in addition the storage being used currently is the window.localStorage api that is ephemeral and will be lost when someone clears their browser history. This will make someone angry I guarantee it. The chrome.localStorage API is asynchronous though so it will require a touch of changes. if you want to use promises and async/await there is a browser polyfill that ports the firefox promise based browser webExt apis to chrome.

@plibither8 plibither8 added the enhancement New feature or request label Jul 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants