"Chrome PDF查看器"在哪里?扩展名"mhjfbmdgcfjbbpaeojofohoefgiehjai"位于? [英] Where is "Chrome PDF viewer" extension "mhjfbmdgcfjbbpaeojofohoefgiehjai" located?

查看:111
本文介绍了"Chrome PDF查看器"在哪里?扩展名"mhjfbmdgcfjbbpaeojofohoefgiehjai"位于?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何找到chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai(隐藏的"Chrome PDF查看器")文件夹?

在打印PDF之前,我需要访问这些文件并更改其JavaScript以向我发送消息.

解决方案

它是Chrome的内部组件;它实际上不是要浏览的物理文件夹,而是编译为Chrome自己的文件(特别是 resources.pak -谢谢,wOxxOm).

您可以从Chromium源中获取该扩展程序的源代码,例如

..它实际上不会那样工作,因为清单使用提升的私人"权限.

 权限":["chrome://resources/",内容设置","metricsPrivate","resourcesPrivate"],"content_security_policy":脚本-src'self'blob:文件系统:chrome://resources; object-src * blob:externalfile:文件:文件系统:data :;插件类型application/x-google-chrome-pdf", 

..不能在非内部扩展程序中使用:

因此,如果您真的要修改内部PDF查看器,则需要编译自己的Chromium修改版本,或者至少编译自己的 resources.pak版本..可能不是您想做的.

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.

这篇关于"Chrome PDF查看器"在哪里?扩展名"mhjfbmdgcfjbbpaeojofohoefgiehjai"位于?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆