我正在探索wit.ai并想在firefox附加组件中尝试一下。我按照此网站快速启动guide解释了如何在网页中实施。
如果我将其作为网页运行,可以使用firefox弹出麦克风权限,但是当我将其作为附加组件实现时,firefox不会弹出权限并从javascript中记录说,麦克风正在连接暗示它仍然没有获得许可。
如何获得从firefox附加组件访问麦克风的权限?
答案 0 :(得分:1)
我实际上是在做同样的事情。
这是怎么做的 - https://github.com/Noitidart/FoxSpeak/issues/4
我们在这里看到 - https://dxr.mozilla.org/mozilla-central/source/browser/modules/webrtcUI.jsm#170
receiveMessage: function(aMessage) {
switch (aMessage.name) {
// Add-ons can override stock permission behavior by doing:
//
// var stockReceiveMessage = webrtcUI.receiveMessage;
//
// webrtcUI.receiveMessage = function(aMessage) {
// switch (aMessage.name) {
// case "rtcpeer:Request": {
// // new code.
// break;
// ...
// default:
// return stockReceiveMessage.call(this, aMessage);
//
// Intercepting gUM and peerConnection requests should let an add-on
// limit PeerConnection activity with automatic rules and/or prompts
// in a sensible manner that avoids double-prompting in typical
// gUM+PeerConnection scenarios. For example:
他们允许插件注入此处。我没时间完成这个,但如果你在我之前完成,请分享。 :)