How can I find the folder for chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai (the hidden "Chrome PDF viewer")?
I need to access these files and change its JavaScript to send me a message before printing a PDF.
It's an internal component of Chrome; it's not really a physical folder to navigate to, this is compiled into the Chrome's own files (specifically resources.pak
- thanks, wOxxOm).
You can get the source code of that extension from the Chromium source, e.g. https://chromium.googlesource.com/chromium/src.git/+/71.0.3578.98/chrome/browser/resources/pdf - note that those still need compilation with the Closure Compiler, so not usable for modification as-is.
But suppose you do modify and compile it. Can you install your modified version? Yes and no.
While it is technically possible to override the extension by presenting an unpacked extension with a higher version
and the same key
in the manifest..
..it will not actually work like that, because the manifest uses elevated "private" permissions..
"permissions": [
"chrome://resources/",
"contentSettings",
"metricsPrivate",
"resourcesPrivate"
],
"content_security_policy": "script-src 'self' blob: filesystem: chrome://resources; object-src * blob: externalfile: file: filesystem: data:; plugin-types application/x-google-chrome-pdf",
..that can't be used from a non-internal extension:
So if you really wanted to modify the internal PDF viewer, you'd need to compile your own modified version of Chromium, or at the very least your own version of resources.pak
. Probably not what you want to do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With