manifest permission entry for the web feature that requires permission prompting

14 views
Skip to first unread message

Takashi Toyoshima

unread,
Jul 6, 2015, 12:43:12 AM7/6/15
to apps...@chromium.org
Hi, I'm working on Web MIDI API that was shipped at Chrome m43, and this question is for the API. But the question could be a common thing for new web features that requires permission prompting.

As far as I know, powerful features that requires permission prompting like geolocation and getUserMedia provide a permission entry for the Chrome Apps manifest.

I'm not sure my survey is up to date, but when Chrome used infobar for permissions, the infobar wasn't available from Chrome Apps, so the manifest declaration was the only way to use such web features. Is this still true? And how can I add a new entry for the Web MIDI permission?

--
Takashi Toyoshima
Software Engineer, Google

Mike Tsao

unread,
Jul 6, 2015, 11:24:27 AM7/6/15
to Takashi Toyoshima, apps...@chromium.org, kal...@chromium.org, roc...@chromium.org, asar...@chromium.org
A starting point is _permission_features.json+Benjamin Kalman+Ken Rockot, or +Antony Sargent would have a more detailed roadmap to get there.

Ken Rockot

unread,
Jul 6, 2015, 12:11:23 PM7/6/15
to Mike Tsao, Takashi Toyoshima, apps-dev, kal...@chromium.org, asar...@chromium.org
Yeah there are a few places you need to poke in order to bring a new permission into existence:
  1. Add an entry to //chrome/common/extensions/_permission_features.json. If this is just for apps, something like the entries for "appview" or "serial" is what you want here.
  2. Add a corresponding entry to the |permissions_to_register| in //extensions/common/permissions/extensions_api_permissions.cc. This also means adding an entry in the APIPermission::ID enum (see //extensions/common/permissions/api_permission.h)
That's pretty much it. extension->permission_data()->HasAPIPermission(APIPermissions::kMidi)  [or whatever you call it] can be used to test if a given |extension| has the permission specified.

To unsubscribe from this group and stop receiving emails from it, send an email to apps-dev+u...@chromium.org.

Benjamin Kalman

unread,
Jul 6, 2015, 6:04:49 PM7/6/15
to Ken Rockot, Devlin Cronin, Mike Tsao, Takashi Toyoshima, apps-dev, asar...@chromium.org
I'd like to solve this independently of the extension permission system. Web API authors shouldn't need to know about extension internals.
  • We will very soon have a place for this in the extension toolbar. In the same way that infobars/bubbles are used by webpages to request access to APIs, we should use bubbles that point to the extension toolbar icon.
  • Nobody has the motivation to make this work for Apps unfortunately.
but, in lieu of that, you can tack it onto our permission system like Ken has pointed out.

Takashi Toyoshima

unread,
Jul 7, 2015, 2:33:59 AM7/7/15
to Benjamin Kalman, Ken Rockot, Devlin Cronin, Mike Tsao, apps-dev, asar...@chromium.org
Thanks, Mike, Ken, and Benjamin,

I'll check code Ken has pointed out.
Reply all
Reply to author
Forward
0 new messages