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

localstorage key naming #7760

Closed
TZanke opened this issue Oct 28, 2016 · 2 comments
Closed

localstorage key naming #7760

TZanke opened this issue Oct 28, 2016 · 2 comments
Labels

Comments

@TZanke
Copy link

TZanke commented Oct 28, 2016

At the moment PDF.js saves data from "showPreviousViewOnLoad" to local storage with the key database.

I would like to change the key for standalone installations of PDF.js because database could easily used from someone else. Also database isnt very intuitive for a developer, finding the source of this key.

Wish: Change it to somethine like pdf.js-database

@timvandermeij
Copy link
Contributor

It's possibly defined here:

localStorage.setItem('database', databaseStr);

We have pdfjsHistory just above it, so I'm not sure why the name database is chosen. Feels like a bad name to me too. I'm not sure if we can just change that as it might mean that older preferences get lost. Let's see if others have ideas for this.

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Oct 28, 2016

We have pdfjsHistory just above it, so I'm not sure why the name database is chosen.

pdfjsHistory is specific to the Firefox addon/built-in version, hence it may not be entirely relevant to the current discussion.
The name database, for e.g. the GENERIC viewer, has been used basically since "forever", hence I don't think we can just rename it without trying to migrate existing data first (which shouldn't be too hard).
A better name might be pdfjs.history for the ViewHistory entries (since it follows the same naming convention as in preferences.js#L204).

Edit: Something like e.g. master...Snuffleupagus:ViewHistory-storage-key-name would probably work, provided of course that we want to change this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants