Giter Club home page Giter Club logo

local-storage-js's People

Contributors

brettwejrowski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

local-storage-js's Issues

Key collisions for non-identical strings

The userData API storage mechanism uses HTML attributes to store key/values; attribute names are case-insensitive. The cleanKey mechanism maps all non-attribute characters to "-". Together, this means that the following keys would be treated as the same:

"A-B-C"
"a-b-c"
"a%b*c"

This could lead to data overwrites if arbitrary keys are used.

Here's one possible key escaping mechanism to avoid this:

function (key) {
key = String(key);
var m = ['k'], len = key.length;
for (var i = 0; i < len; ++i) {
m.push(key.charCodeAt(i).toString(36));
}
return m.join('-');
}

"The operation is insecure." in Firefox

Newer Firefox browsers throw this error when localStorage is accessed and cookies have been disabled. Is there a way to workaround this behavior (not throw an error) with this lib?

IE7 key:value pairs persist across single pages but not entire domain

It's entirely possible that I'm missing something here, but in IE7 the key:value pairs are not persisting across the entire domain.

They are persisting across page refreshes and browser restarts for individual pages, but as soon as I go to a different page on the same domain, the data is no longer there.

Here's what I'm doing. I'm trying to store a setting across pages. After I load your script, I test if a localStorage value exists already. If it doesn't exist, then I create/set the value:

var settingExists = typeof localStorage.getItem('theKey') === "string";

if ( !settingExists ) {
  localStorage.setItem("theKey", "the value");
}

That works great on a page refresh. But when I go to a different page on the same domain, localStorage.getItem('theKey') returns null (where I would expect it to be set already from the previous page).

Am I missing something really basic here?

[enhancement] Add missing bower.json.

Hey, maintainer(s) of wojodesign/local-storage-js!

We at VersionEye are working hard to keep up the quality of the bower's registry.

We just finished our initial analysis of the quality of the Bower.io registry:

7530 - registered packages, 224 of them doesnt exists anymore;

We analysed 7306 existing packages and 1070 of them don't have bower.json on the master branch ( that's where a Bower client pulls a data ).

Sadly, your library wojodesign/local-storage-js is one of them.

Can you spare 15 minutes to help us to make Bower better?

Just add a new file bower.json and change attributes.

{
  "name": "wojodesign/local-storage-js",
  "version": "1.0.0",
  "main": "path/to/main.css",
  "description": "please add it",
  "license": "Eclipse",
  "ignore": [
    ".jshintrc",
    "**/*.txt"
  ],
  "dependencies": {
    "<dependency_name>": "<semantic_version>",
    "<dependency_name>": "<Local_folder>",
    "<dependency_name>": "<package>"
  },
  "devDependencies": {
    "<test-framework-name>": "<version>"
  }
}

Read more about bower.json on the official spefication and nodejs semver library has great examples of proper versioning.

NB! Please validate your bower.json with jsonlint before commiting your updates.

Thank you!

Timo,
twitter: @versioneye
email: [email protected]
VersionEye - no more legacy software!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.