Mimetype handling by chrome extension (packaged apps)

穿精又带淫゛_ 提交于 2019-12-24 21:16:22

问题


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


回答1:


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)



来源:https://stackoverflow.com/questions/14713109/mimetype-handling-by-chrome-extension-packaged-apps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!