KaBa
KaBa

Reputation: 285

Native Client Packaged App and MIME type

Using a NaCl packaged app, is it possible to handle a MIME type for a dummy resource within a webpage (the type and location of resource does not matter e.g from the app pkg)?

I need it to just launch the already installed packaged app without user's mouse click.

Thank you!

Upvotes: 1

Views: 233

Answers (1)

binji
binji

Reputation: 1860

Yes, you can handle a mimetype from an Native Client app. See https://developer.chrome.com/apps/manifest/nacl_modules.

Basically, you add this to your manifest.json:

"nacl_modules": [{
  "path": "NaClModule.nmf",
  "mime_type": "application/x-my-fancy-mimetype"
}],
...

When the user clicks a link to an object with this mimetype, Chrome will open a new window, create a fullscreen Native Client module, and pass the URL as src:

<embed type="application/x-my-fancy-mimetype" src="url-of-file">

Upvotes: 4

Related Questions