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

316
Visualizações
Error accessing "autoAllocateChunkSize" in PDFJS

i have a new problem after firefox 99 update. I have an extension that reads pdfs using PDFJS (version pdfjs-2.13.216). It always worked and after the last update it started to give: Error: Permission denied to access property "autoAllocateChunkSize" The same extension, with tiny changes, works in chrome normally. Below is the code:

function getAllTextPDF(urlPDF) {
    return new Promise(function (resolve , reject ) {
        var pdfjsLib = this['pdfjs-dist/build/pdf'];  //this because of firefox
        pdfjsLib.GlobalWorkerOptions.workerSrc = '//mozilla.github.io/pdf.js/build/pdf.worker.js';

        var loadingTask = pdfjsLib.getDocument(urlPDF);
        
        //** from that line it no longer enters and generates the mentioned error **
        loadingTask.promise.then(function(pdf) {
            var numPages = pdf._pdfInfo.numPages;
            var textoFinal = '';
            var pagesPromises = [];
          
            for (var i = 0; i < numPages; i++) {                
                (function (pageNumber) {
                    pagesPromises.push(getPageText(pageNumber, pdf));
                })(i + 1);
            }
                            
            Promise.all(pagesPromises).then(function (pagesText) {

                for (var i = 0; i < pagesText.length; i++) {
                    textoFinal += pagesText[i];
                }
                
                if(textoFinal.length > 0){
                    resolve({text: textoFinal});
                    
                    loadingTask.destroy();
                    delete pdfjsLib;
                    delete loadingTask;
                }                   
            });
        
        }, function (reason) {
            // PDF loading error
            reject({reason});
            return 0;
        });
        
    });          
}

example URL of file to read (worked normally):

blob:https://dominio.com/4db038e1-ae8d-4a15-a78f-0d9d0a182c7c

The idea of ​​the method is simple, go through the pdf file and return all the text. However now as mentioned the error is generated. Detail that did not generate the error in version 32bit firefox, I believe it started in the last update of firefox 99.

I appreciate your help.

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