V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
zsh1995
V2EX  ›  程序员

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

  •  
  •   zsh1995 · 2019-10-02 01:35:56 +08:00 · 1622 次点击
    这是一个创建于 1661 天前的主题,其中的信息可能已经有所发展或是发生改变。
    当前用的 chrome 版本是 77,在调试时发现获取 window.DeviceOrientationEvent 是 undefined,排除了半天才发现是 http 的锅,只有 https 的网站才能拿到 DeviceOrientationEvent。那开发时弄个 https 也挺麻烦,有啥别的方法绕过吗?
    2 条回复    2019-10-03 04:52:13 +08:00
    Pastsong
        1
    Pastsong  
       2019-10-02 06:55:06 +08:00
    localhost 可以绕过
    codehz
        2
    codehz  
       2019-10-03 04:52:13 +08:00   ❤️ 2
    chrome://flags/#unsafely-treat-insecure-origin-as-secure 填上你需要的域名,然后重启)
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1256 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 23:29 · PVG 07:29 · LAX 16:29 · JFK 19:29
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.