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

前端 未结 4 1040
粉色の甜心
粉色の甜心 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条回答
  •  孤城傲影
    2020-12-31 07:48

    Asking for navigator.webkitGetUserMedia in options.js works but you MUST open option.html popup in a NEW TAB or you will obtain an error so in the manifest.json you must to write

    "options_ui": {
        "page": "options.html",
        "chrome_style": true,
        "open_in_tab": true
      }
    

提交回复
热议问题