If you use Chrome and go to this page: https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf I am wondering if you can run your Chrome Extension on that page.
I'd be fine with either content_script or background.js working.
when I console.log on mouse movements or just when content_script is usually injected, nothing shows up.
I noticed this post Run a Chrome Plugin On a PDF Page but it, unfortunately, didn't work for me.
This is my manifest.json
:
{
"name": "Extension",
"description": "Fancy stuff",
"version": "1.0.0",
"manifest_version": 2,
"permissions": [
"https://*/*",
"http://*/*",
"tabs",
"webRequest",
"webRequestBlocking",
"webNavigation",
"management",
"sessions",
"<all_urls>",
"activeTab"
],
"background": {
"scripts": ["background.js"],
"persistent": true
},
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*" ],
"js": ["content_script.js"],
"match_about_blank": true, // Needed for docs.google.com. Dunno why!
"all_frames": true,
"run_at": "document_start"
},
{
"matches": ["http://*/*", "https://*/*"],
"js": ["document_idle.js"],
"match_about_blank": true, // Needed for docs.google.com. Dunno why!
"all_frames": true,
"run_at": "document_idle"
}
]
}
Right now, I have a console.log('hi')
in content_script.js
but I don't see the output of that when I open inspector which is leading me to believe it never runs.