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
}