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

230
Visualizações
Execute script on Chrome PDF Viewer

Hi i am working on a chrome extension that inject a script into the web page and it's working fine on any other website but not on pdf files.

after some research i understand that the pdf viewer is an application/plugin that is executed inside the webpage so any script goes the the web page but not the pdf.

is there any way to execute java script on the page like just a console.log() nothing hard.

and thank you

edit: MVC

Manifest.js:

"version": "1.0",
"manifest_version": 3,
"background": {
    "service_worker": "background.js"
},


"permissions": ["storage", "activeTab", "scripting"],
"action": {
    "default_popup": "popup.html",

Example Script: store the current position of the scroll wheel

let purl = window.location.toString();


if(purl.match(/pdf$/g)){
  //alert("PDF's are not supported... For now 😉");
  
Posp=document.querySelector("#viewer").shadowRoot.querySelector("#scroller").scrollTop;
//this always return 0 because it's not executing inside the pdf viewer but the source tab
}
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