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

220
Views
Read csv file in JavaScript array with Chrome extension using Papa Parse

I want the user to be able to select a single column CSV file, which then gets loaded in a 1D Javascript array.

I'm trying to do this with Papa Parse and when I try my code in a codepen it works, so the issue must be with the Chrome extension environment.

popup.html:

<!DOCTYPE html>
<html>

<head>
</head>

<body>
    <form id="csvForm">
        <label for="avatar">Select a csv list:</label>
        <input type="file" id="csvFile" accept=".csv">
        <input type="submit" id="load" value="Load">
    </form>
    
    <script src="papaparse.min.js"></script>
    <script src="popup.js"></script>
</body>

</html>

popup.js:

let loadButton = document.getElementById("load").addEventListener("click", () => {
    Papa.parse(document.getElementById("csvFile").files[0], {
        download: true,
        header: false,
        complete: function (results) {
            console.log(results);
        },
    });
});
about 4 years ago · Santiago Gelvez
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!