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

169
Vistas
Generate new used JS file using Puppeteer

I'm trying to improve the load times on some sites by creating new JS files containing only the ATF code, using Puppeteer.

I've done this for CSS already but the same code doesnt work for JS as its deleting some parent wrappers but keeping the code inside so the format comes out all wrong.

Is there a specific flag I can use with Puppeteer or some additional checks I can add to the code in order to prevent this?

Any help is appreciated.

//map over array, check and add new text to var
js_coverage.map(e => {
    if(e.url.includes('20210728')){
        for(const range of e.ranges){
            covered_js += e.text.slice(range.start, range.end) + "\n";
        }
        // console.log(e);
    }
})

//write new text to new .js file 
fs.writeFile("./exported_js.js", covered_js, function(err){
    if(err){
        return console.log(err);
    }
    console.log("JS Exported BOI!")
})
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