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

320
Vistas
How can I implement Redis into my chrome extension?

I am trying to import Redis into my chrome extension and I get an error every time I try to open the popup. The error is Uncaught ReferenceError: require is not defined. Redis is installed through npm and I have the Redis CLI/server working. The code below is in my popup.js file.

const redis = require("redis");

getdata();

const redisclient = createClient();

function getdata() {
  setTimeout(function () {
    chrome.storage.local.get(
      ["storedvideotitle", "storedchannelname"],
      function (result) {
        chrome.runtime.sendMessage({});
        document.getElementById("videoname").innerHTML =
          result.storedvideotitle;
        document.getElementById("channelname").innerHTML =
          result.storedchannelname;
      }
    );
  }, 50);
}

document.addEventListener("DOMContentLoaded", function () {
  document.getElementById("star1").addEventListener("click", b1pressed);
  document.getElementById("star2").addEventListener("click", b2pressed);
  document.getElementById("star3").addEventListener("click", b3pressed);
  document.getElementById("star4").addEventListener("click", b4pressed);
  document.getElementById("star5").addEventListener("click", b5pressed);
});

function b1pressed() {
  redisclient.set("star", "1");
}
function b2pressed() {
  redisclient.set("star", "2");
}
function b3pressed() {
  redisclient.set("star", "3");
}
function b4pressed() {
  redisclient.set("star", "4");
}
function b5pressed() {
  redisclient.set("star", "5");
}
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