html - 如何让HTML5语音识别不再每次都请求许可

标签 html google-chrome permissions microphone

我创建了一个需要麦克风的脚本。它使用 HTML5 语音识别 API。每次我想要执行语音识别测试时,Chrome 都会请求许可。

我正在使用的Javascript(部分)代码:

         var recognition = new webkitSpeechRecognition();
            recognition.continuous = true;
            recognition.interimResults = true;
            recognition.onresult = function(event) {
                console.log(event.results[0][0].transcript);
                if(event.results[0][0].transcript === 'print')
                {
                    console.log('');
                }
            };

            recognition.start();

我尝试将其添加到 Chrome 和 Flash 播放器的异常(exception)列表中,但它仍然请求许可。

打印屏幕:

Print screen example

每次我单击按钮时都会弹出该消息。 有什么办法可以禁止 Chrome 请求许可吗?

最佳答案

正如jschorr在上面的评论中提到的,仅使用HTTPS将防止浏览器在每次启动识别时请求权限

正如明确指出的here

关于html - 如何让HTML5语音识别不再每次都请求许可,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25367691/

相关文章:

css - 如何在 Chrome 开发者工具中过滤并仅显示应用的 CSS(如 Firefox 中的 Firebug)

Chrome 28 中的 Flash 与 native 网络摄像头权限

c# - 使用用户名和密码在 C# 中启动进程会引发 "Access is Denied"异常

javascript - 无法获取 jQuery 日期选择器

python - 如何在Django中引用不同应用程序中的不同模板?

html - GIF 未在 Chrome 中显示

macos - Mac OS X 上的 XAMPP 权限?

javascript - jQuery wrap 打破 CSS 伪元素

html - Youtube https 嵌入在 Firefox 中导致警告

postgresql - 使用持久数据运行 postgresql docker 镜像返回权限错误