Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

229
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
ยฉ 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!