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

195
Views
Data doesn't store in chrome.storage.local from popup for chrome extension

I am creating a chrome extension, when you click on the extension icon you will be asked to sing in or sign up.

enter image description here

When click "sign in" button a window will popup (see below) and ask you to enter your credentials.

enter image description here

I am using Firebase, so after the user sign in I want to store their UserID in local storage.

chrome.storage.local.set({UserID: userCredential.user.uid}, function(){
        chrome.storage.local.get(["UserID"], function(result) {
          console.log('Value currently is ' + result.key);
        });
        console.log("Stored in storage")
      })

console.log('Value currently is ' + result.key) prints Value currently is undefined and when I look at the localstorage using DevTools, there is nothing there. There is no issue with my firebase code, when I do console.log(userCredential.user.uid) it prints the correct info.

This is my permission in manifest.json:

"permissions": [
    "tabs",
    "activeTab",
    "scripting",
    "*://*/*",
    "storage",
    "identity"
]

I want to store the userID in local storage, so when the user clicks on the extension icon, the extension checks to see if userID exists in local storage, and if userID is in local storage then it will display the user info. If there is no userID it will display the "Sign In/Sign Up" buttons.

about 4 years ago · Juan Pablo Isaza
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!