尽管有标志,Chrome仍不将不安全来源视为安全 [英] Chrome doesn't treat insecure origin as secure despite flag

查看:154
本文介绍了尽管有标志,Chrome仍不将不安全来源视为安全的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Windows上的Chrome的不安全来源上测试getUserMedia.我按照goo.gl/rStTGz上的说明以这种方式启动Chrome,如果您使用getUserMedia:

I want to test getUserMedia on an insecure origin on Chrome on Windows. I am starting Chrome in this way as instructed on goo.gl/rStTGz, a link that shows up in the console if you use insecure origin with getUserMedia:

start chrome "http://my-ip:8000/index.html" --unsafely-treat-insecure-origin-as-secure="http://my-ip" --user-data-dir=/tmp

index.html中是这样的:

navigator.getUserMedia({ audio: true, video: { width: 1280, height: 720 } }, stream => console.debug(stream), e => console.error(e))

即使我做了第一个链接所说的,它仍然给我错误.该错误包括另一个链接goo.gl/Y0ZkNV,该链接根本没有提及如何解决此问题以进行测试.

It still gives me error even though I did what the first link said. This error includes another link goo.gl/Y0ZkNV which doesn't mention how to work around this for testing at all.

此功能仍受支持吗?看起来是这样,因为Chrome确实确实是从新的配置文件开始的,并显示有关使用上述标志的警告. Chrome显然会读取该标志,但未对其执行任何操作.为什么?

Is this still supported? It would seem so, because Chrome indeed did start with a fresh profile and shows a warning about using the aforementioned flag. The flag is obviously read by Chrome, but not acted upon. Why?

推荐答案

您还需要在标志中指定端口.试试

You need to specify the port in the flag as well. Try

start chrome "http://my-ip:8000/index.html" --unsafely-treat-insecure-origin-as-secure="http://my-ip:8000" --user-data-dir=/tmp

请注意,不再需要--user-data-dir.请参阅第3点中的注释

Note that --user-data-dir is no longer required. See the note in point #3 here.

这篇关于尽管有标志,Chrome仍不将不安全来源视为安全的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆