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

231
Vistas
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 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