RobinCK / vue-ls

:boom: Vue plugin for work with local storage, session storage and memory storage from Vue context 🇺🇦
https://robinck.gitbooks.io/vue-storage/
MIT License
538 stars 49 forks source link

error: "SecurityError: The operation is insecure. " in firefox #148

Open luneshao opened 4 years ago

luneshao commented 4 years ago

hello, when i use vue-ls package in my project(with vue-cli), it will throw error when Firefox opens.The error like "SecurityError: The operation is insecure." And, it is OK in Chrome and Opera.

error screenshot in firefox

version msg:

my code

// main.js
import Vue from 'vue';
import VueLs from 'vue-ls';

const options = {
  namespace: 'test__', // key prefix
  name: 'ls', // name variable Vue.[ls] or this.[$ls],
  storage: 'local', // storage name session, local, memory
};

Vue.use(VueLs, options);

Hope for your help :)

mskry commented 2 years ago

Some browsers disabling localStorage/sessionStorage in private mode, you can run a test and catch the exception before library initialization Feature-detecting localStorage