通过Chrome扩展进行Mimetype处理(打包的应用程序) [英] Mimetype handling by chrome extension (packaged apps)

查看:488
本文介绍了通过Chrome扩展进行Mimetype处理(打包的应用程序)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我看到在清单文件中,nacl_modules可能是一个包含一个mimetype的文件。用于将本机客户端模块与mimetype关联。



我需要打包的应用程序来处理特定mimetype的桌面文件。



由于打包的应用程序可以在没有显示Chrome的情况下启动并运行,似乎可能,但问题在于如何!



感谢您的意见和建议。



Guy

解决方案

您可以使用以下清单部分处理文件:
http://developer.chrome.com/trunk/apps/manifest.html#file_handlers

 file_handlers:{
testhandler:{
title:TestHandler,
types:[* / *]
}
},
permissions:[fileSystem],

所选文件将在onLaunched事件处理程序的launchData参数中传递。



请注意,从文件管理器启动时,此文件不可用Chrome操作系统。在这些平台上,如果您从命令行执行应用程序并将文件名作为参数( http://developer.chrome.com/trunk/apps/first_app.html#open


I'm wondering if a file, with a given mimetype, can be handled by a packaged app.

I saw that in manifest file, the nacl_modules could be used to associate a native client module with a mimetype.

I need my packaged app to handle desktop files with a specific mimetype.

As packaged app could be up and running without Chrome being displayed it seems possible, but the question is how !

Thanks for your advice and comments.

Guy

解决方案

You can handle files using this manifest section: http://developer.chrome.com/trunk/apps/manifest.html#file_handlers

   "file_handlers": {
     "testhandler": {
       "title": "TestHandler",
       "types": ["*/*"]
      }
    },
   "permissions": ["fileSystem"],

The selected file(s) will then be passed in the launchData param of onLaunched event handler.

Notice that this is not yet available when launching from a file manager on platforms other than ChromeOS. On those platforms, it will only work now if you execute the app from the command line with the filenames as parameters (http://developer.chrome.com/trunk/apps/first_app.html#open)

这篇关于通过Chrome扩展进行Mimetype处理(打包的应用程序)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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