Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

140
Views
Adding multiple local storage for same site

enter image description here

  • Under the 'Application' tab of chrome I've found there are multiple localstorage (please see the yellow box) like - https://stackoverflow.com , https://www.google.com etc.
  • I'm now in stackoverflow (#1)
  • I'm trying to add a new local storage by the name https://mytestdomain.com so I can see it in the yellow box
  • I've tried the following javascript code to achieve this
var testObject = { 'one': 1, 'two': 2, 'three': 3 };  
localStorage.setItem('https://mytestdomain.com', JSON.stringify(testObject));
  • but it always gets added under the localstorage - https://stackoverflow.com (#2, #3). It's not being added as a new localStorage

Can anyone help me here?

Thanks in advance.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

That yellow box in the image represents all the sites which are storing some data in your localstorage. You cannot add a sitename (i.e https://mytestdomain.com) using localstorage.setItem().

Using localstorage.setItem('key', 'val') only set value in current domain's local Storage

If you want some value under https://mytestdomain.com domain, there should be a site with url - https://mytestdomain.com storing something in your localstorage.

Check here in the official doc for more info - Documentation Link

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!