最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Where is "Chrome PDF viewer" extension "mhjfbmdgcfjbbpaeojofohoefgiehjai" locat

programmeradmin4浏览0评论

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.

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.

Share Improve this question edited Dec 20, 2018 at 14:44 Xan 77.5k18 gold badges197 silver badges217 bronze badges asked Dec 20, 2018 at 10:00 HTardaHTarda 1011 gold badge1 silver badge6 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 12

It's an internal ponent of Chrome; it's not really a physical folder to navigate to, this is piled 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./chromium/src.git/+/71.0.3578.98/chrome/browser/resources/pdf - note that those still need pilation with the Closure Compiler, so not usable for modification as-is.

But suppose you do modify and pile 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 pile your own modified version of Chromium, or at the very least your own version of resources.pak. Probably not what you want to do.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论