NPAPI 插件未在 Chrome 上加载

发布于 2024-11-25 10:54:31 字数 179 浏览 9 评论 0原文

我有一个由 dll 和 manifest.json 文件组成的 npapi 插件。此 npapi dll 被检测为 chrome 上的插件,即它列在 about:plugins 页面上。但是,当我使用标签在示例 html 页面中调用此插件时,它显示“插件加载失败”。 任何想法为什么这个插件无法在 chrome 中加载。

谢谢

I have a npapi plugin composed of a dll and manifest.json file. This npapi dll is detected as plugin on chrome ie it is listed on about:plugins page. However, when I invoke this plugin in sample html page using tag, it says 'Plugin failed to load'.
Any ideas why this plugin fails to load in chrome.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

怎樣才叫好 2024-12-02 10:54:31

根据您提供的信息,无法确定,但我猜这是两件事之一:

  1. 您的插件可能具有未找到的外部依赖项。如果您链接到另一个需要 .DLL 文件的库(或者如果您使用 /MD 作为 CRT 的 DLL 版本),并且当浏览器尝试加载插件 DLL 时找不到 DLL,则您的插件将默默地无法加载

  2. 您的插件 DLL 可能正在加载,但随后抛出异常、错误处理等,从而导致浏览器认为它不是有效的插件。很可能情况并非如此,因为 Chrome 通常会将类似的情况报告为崩溃,而不是缺少插件。不过,您可以通过使用命令行参数 --plugin-startup-dialog 启动 Chrome 来验证这一点,这将导致在加载插件 DLL 之前弹出一个包含 pid 的对话框。然后,您可以附加一个调试器并告诉它继续。

在这两个问题中,第一个是迄今为止我看到的最常见的问题。您可以通过获取 Dependency Walker (depends.exe) 并就地打开 DLL 以查看缺少的内容来对其进行故障排除。如果您看到ieshims.dll,请忽略它——它总是认为该文件丢失了,但在浏览器运行时会找到它。

有关调试插件的更多提示可以在 http://npapi.com/x/MYAG 找到如果您还没有使用,我建议您使用 FireBreath 框架,它可以解决您可能遇到的大多数 NPAPI 问题。

祝你好运!

With the information you have provided it is impossible to say for sure, but I would guess it is one of two things:

  1. Your plugin may have an external dependency that isn't being found. If you are linking to another library that requires a .DLL file (or if you're using /MD for the DLL version of the CRT) and the DLL can't be found when the browser tries to load the plugin DLL then your plugin will silently fail to load

  2. Your plugin DLL may be loading but then throwing an exception, incorrectly handling things, etc in such a way that the browser decides that it isn't a valid plugin. Most likely this isn't the case, since Chrome usually reports something like that as a crash, not a missing plugin. You can verify this, though, by starting Chrome with the command line argument --plugin-startup-dialog, which will cause a dialog with the pid to pop up before the plugin DLL is loaded. You can then attach a debugger and tell it to continue.

OF those two, the first is by far the most common issue I see. You can troubleshoot it by getting Dependency Walker (depends.exe) and opening the DLL in-place to see what is missing. If you see ieshims.dll ignore it -- it always thinks that's missing, but finds it when the browser is running.

More tips on debugging plugins can be found at http://npapi.com/x/MYAG and of course if you're not already I'd recommend using the FireBreath framework which solves most NPAPI problems you may run into for you.

Good luck!

携君以终年 2024-12-02 10:54:31

您必须在插件 .rc 文件中定义 MIME 类型。如果不这样做,插件将无法正确加载:

值“MIMEType”、“application/myapp”

You have to define MIME type in the plugin .rc file. Failing to do this prevent the plugin to load properly :

VALUE "MIMEType", "application/myapp"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文