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

213
Views
App that converts image to base64 string displays different results on browser's console when run in headed and headless mode. Does anyone know why?

I'm using Playwright to write an automated test for a Node.js app. The app has a test web page with a button that allows to manually select an image, which will then be processed and converted to a base64 string, which will be logged on the browser's console for verification. The automated test I'm writing simulates the manual actions and then compares the base64 string logged in the console with another one saved on a file.

The image is decoded to base64 by the FileReader class, with the readAsDataURL() method (documentation here), as shown on the snippet below:

            reader.onload = () => {
                EXIF.getData(file, () => {
                    const imageBase64 = reader.result

                    // more code here
                })
            }

            reader.readAsDataURL(file)

The issue I'm facing is that when the test is run with a Chrome headed browser, the base64 is different than when it is run with a Chrome headless browser, even though the image is the same. Does anyone know why?

over 4 years ago · Santiago Trujillo
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!