chrome http 协议的网站无法获取 window.DeviceOrientationEvent

2019-10-02 01:35:56 +08:00
 zsh1995
当前用的 chrome 版本是 77,在调试时发现获取 window.DeviceOrientationEvent 是 undefined,排除了半天才发现是 http 的锅,只有 https 的网站才能拿到 DeviceOrientationEvent。那开发时弄个 https 也挺麻烦,有啥别的方法绕过吗?
1636 次点击
所在节点    程序员
2 条回复
Pastsong
2019-10-02 06:55:06 +08:00
localhost 可以绕过
codehz
2019-10-03 04:52:13 +08:00
chrome://flags/#unsafely-treat-insecure-origin-as-secure 填上你需要的域名,然后重启)

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/605943

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX