Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

199
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda