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

325
Views
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
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!