When I put code on console (F12) on normal page this code works, normally has https:// address. But when it comes to local file or when i open pdf on browser, the F12 code doent work, but when you inspect its own devtool which it popup, eg. file:///C:/Users/Downloads/NPL/work.pdf it works. But wondering how can i do that or execute it instead on popup.js so can i just click it without inspecting, to auto scroll that page of pdf.
This my code. And want this execute also this on that page like that too..
// Auto-scroll function
function autoScroll() {
// Adjust scroll speed by changing the value inside setInterval (milliseconds)
let scrollInterval = setInterval(() => {
window.scrollBy(0, 10); // Adjust the scroll amount (vertical scroll)
// Condition to stop scrolling (example: scroll to 1000px)
if (window.scrollY >= 1000) {
clearInterval(scrollInterval); // Stop scrolling
}
}, 100); // Adjust the interval for smoother or faster scrolling
}
// Call autoScroll function to start scrolling
autoScroll();
Tried check Allow access to file URLs, but can't. I think this manifest.json will do that for that permission.. Expecting for simple code for popup.js and manifest,json. Hope you have.. Tried also this, permissions": [ "activeTab", "declarativeContent" ], but cant still.. Graci