Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [browser-storage]

Data stored by a web browser in a nonvolatile format, often used for configuration or caching.

1
vote
1answer
34 views

Unit Test case to check if localstorage is empty once I logout of the Web app

I am trying to clear my localstorage when I am logging out of the application. I want to write a unit test case in Jasmine to check if this task is performed when logout function is run. I am writing ...
1
vote
2answers
93 views

DataService that fetches data not loaded already or loads cached values

I load an array from an API that is available throughout the user's whole session. This data is unlikely to change, so it can be cached safely. I have a DataService ...
1
vote
1answer
75 views

Language switcher, consulting browser's localStorage

I'm using angular 6 and ngx-translate. This is my switch language function ...
0
votes
2answers
40 views

Picking a time based on when the app was last used

I am trying to set up a time variable as a local storage property to be retrieved when I open my app in my browser. If I open it for the first time, today, I'll set it up to today at midnight. ...
2
votes
1answer
87 views

yandex-maps service for save places

I made script which create marker on the map after mouse left button click. And after mouse right button click marker removed. All markers coordinates storage in browser localStorage. I use yandex-...
1
vote
1answer
93 views

Places memoized service via Google Maps

I made a service which saves places to localStorage after the user clicks the left mouse button on the map. When the user clicks the right mouse button on the ...
3
votes
2answers
5k views

Getting images and saving them to localstorage

The code in this project accepts an image URL and creates an <img> tag dynamically, using the image URL as the src attribute value. The image *name *and URL ...
3
votes
1answer
696 views

Keeping a search history in localStorage, with a length limit

I'm having a problem figuring out how I can make this particular part of my code DRY. Currently, the code is repeating itself but with minor changes in each case of a switch. SearchParam is a string ...
3
votes
1answer
317 views

Online notepad in JavaScript

I have been told for my code below i need to "Improve and optimise the codebase of the application to reflect modern and best coding practices". Can anyone help me in doing this? As I know the service ...
2
votes
2answers
4k views

AngularJS shopping cart using local storage

Two weeks ago I started writing some Javascript and AngularJS code for a customer. As a proud newby I must also be aware of the dangers on the big bad Internet. In particular vulnerabilities such as ...
6
votes
2answers
1k views

Saving preferences in localStorage

I am working on a small app to help my kids study their multiplication and addition. And I have various preferences I want to be persisted between visits. What do you think of the below to get the ...
3
votes
1answer
7k views

localStorage functions for website shopping cart

As part of a larger web app we are producing, I was asked to help build functionality to tie a page's shopping cart into localStorage for persistence. What follows ...
5
votes
3answers
4k views

Persistent Object using localStorage

The goal is to make an object that persists upon page reloads, have an interface as close as possible to the Object class. ...
4
votes
2answers
2k views

Getters and Setters for localStorage

I have written the following get/set for a username which is stored in local Storage. Do you think this "buys" me anything or even perhaps has major disadvantages? I have never liked relying on ...
5
votes
1answer
2k views

File reader/writer using XPConnect, ActiveX, LiveConnect, Java, HTML5 file storage, or HTTP

I am writing a file writer/reader in JavaScript; I want it to work on local files. It tries to use Firefox's XpConnect, falls back on IE activeX, falls back on Java LiveConnect, falls back on a Java ...