How do I give webkitGetUserMedia permission in a Chrome Extension popup window?

前端 未结 4 1063
粉色の甜心
粉色の甜心 2020-12-31 07:04

I\'ve successfully used webkitGetUserMedia to capture video from my webcam on a normal webpage, but when I try to do this in the popup.html of my Chrome Extension nothing ha

4条回答
  •  Happy的楠姐
    2020-12-31 07:35

    It's a cheap hack, but if you create an options page for your extension and include a call to webkitGetUserMedia in the JS for it, it will request permission for all URIs for that extension, after the user allows it in the options page the background page will also have permission to use it.

提交回复
热议问题