Loading A Native Client Chrome Extension For A Particular MIME Type

丶灬走出姿态 提交于 2020-01-04 04:28:26

问题


I have created a Native Client application for the Google Chrome web browser that plays special types of audio files. Great; that part works very well at this point.

I'm ready to move to the next phase-- sharing this app with the world. I need help with this part.

Per my understanding, the best method for distributing this app is to package it as a Chrome extension, uploading it to the Chrome Web Store (CWS), and using inline install from my website which contains the audio files. Further, this page describes how to associate MIME types with NaCl extensions. I have devised a custom MIME type for this file type.

So here's my question (I think): How do I load the Native Client app from inside the extension?

When I develop this program locally, there is an < embed > tag whose "src" attribute references a .nmf file that points to the .nexe files. The embed tag also has other parameters that are passed to the NaCl app. In the extension scenario, the .nmf and .nexe files (as well as an icon and a manifest.json file) live in the extension.

In the extension scenario, how does the web page specify that the NaCl app inside the extension needs to be loaded? Via an embed tag or some other mechanism? Am I supposed to load the file URL directly and trust that the MIME type will invoke the NaCl extension?

I apologize if this question is confusing-- this is a situation of not really knowing the right question to ask.


回答1:


You need to load a page or a content with the MIME type and browser will invoke NaCl extension and call HandleDocumentLoad method.



来源:https://stackoverflow.com/questions/10845420/loading-a-native-client-chrome-extension-for-a-particular-mime-type

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