Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

168
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda