0

我正在编写一个 chrome 扩展,它需要能够访问文件系统以读取/写入/列出文件。为此,我一直在尝试使用npapi-file-io,但由于没有文档,我没有成功让它工作。

我在扩展的清单中指定了相关的 dll/sos,如下所示:

{
  "name": "npapi-file-io-test",
  "version": "0.0.0",
  "manifest_version": 2,
  "description": "Test extension for npapi-file-io project",
  "plugins": [{"path": "npapi-file-io-32.dll", "public": true},{"path": "npapi-file-io-32.so", "public": true},{"path": "npapi-file-io-64.so", "public": true}]
}

我正在加载并尝试使用这样的插件:

<p><embed type="application/x-npapi-file-io" id="plugin"/></p>
<script type="text/javascript">
    alert(document.getElementById("plugin").getPlatform());
</script>

但我只是得到

Uncaught TypeError: Object #<HTMLEmbedElement> has no method 'getPlatform'

在 Linux Mint 上。

我在这里错过了什么吗?有没有什么好的 NPAPI 嵌入示例可以让我逐步提高?是否有一些替代插件可以用于文件处理?

4

0 回答 0