Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
216 views
in Technique[技术] by (71.8m points)

javascript - How to get the permission in plugin level in chrome extension

I am creating chrome extension using react with inject methodology. Based on the below post i am trying to achieve that,

https://itnext.io/create-chrome-extension-with-reactjs-using-inject-page-strategy-137650de1f39

This is fine... I am expecting to render the webcam inside the extension.I got camera and mic access for extension by injecting an iframe in the webpage that requests permission. But when using camera, permissions are asked from context of webpage and not extension since extension in injected into webpage.I had to give permission in page level to show the webcam.

how to resolve it? P.S. I have reproduced the problem in the repo linked below.Just run npm run build and load the extension in chrome.

Code https://github.com/Nithin-anim/permissions-extension


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...