避免NavigatorUserMediaError“仅允许安全起源”在Chrome中使用HTTP [英] Avoiding NavigatorUserMediaError "Only secure origins are allowed" on HTTP in Chrome
问题描述
我试图用一个用于SIP电话的JavaScript库进行一些音频/视频测试,并且由于Chrome 47,我无法在本地开发中进行测试。
NavigatorUserMediaError {}
constraintName:
message:只允许安全的来源(参见:https:// goo.gl/Y0ZkNV)。
name:PermissionDeniedError
Chrome中有一个选项可以禁用此选项?
或者有没有办法下载Chrome的旧版本(我找不到任何)?
unsafely-treat-insecure-origin-as-secure 标志适用于记录在这里。
在OS X上,这看起来像:
$ / Applications / Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir = / tmp / foo --unsafely-treat-insecure-origin-as- secure = http://alt.local:8080
由于各种原因,我的本地开发服务器不支持' t运行在 localhost 或端口80上。指定替代端口似乎是必需的。
$ b
user-data-dir 指令似乎会在Chrome中创建一个临时沙盒配置文件。
I'm trying to make some audio/video tests with a JavaScript library for SIP phones and since Chrome 47 I can no longer test in local development because of this error:
NavigatorUserMediaError {}
constraintName: ""
message: "Only secure origins are allowed (see:https://goo. gl/Y0ZkNV)."
name: "PermissionDeniedError"
Is there an option (flag) in Chrome to disable this? Or is there a way to download older versions of Chrome (I couldn't find any)?
The unsafely-treat-insecure-origin-as-secure flag works for me as documented here.
On OS X this looks like:
$ /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir=/tmp/foo --unsafely-treat-insecure-origin-as-secure=http://alt.local:8080
For various reasons, my local development server doesn't run on localhost or port 80. Specifying the alternative port appears to be necessary.
The user-data-dir directive appears to create a temporary sandbox profile in Chrome.
这篇关于避免NavigatorUserMediaError“仅允许安全起源”在Chrome中使用HTTP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!