fuxkcsdn

如何检测 video 元素是否被浏览器劫持?

  •  
  •   fuxkcsdn · Sep 11, 2022 · 2083 views
    This topic created in 1369 days ago, the information mentioned may be changed or developed.

    video 元素在安卓 uc 浏览器里被劫持,表现为 video 元素置顶于所有元素上

    下拉菜单因此被遮挡住了

    原本以为是 z-index 设置得不够高,通过对比 document 里所有元素的 z-index ,发现最高的还是下拉菜单

    通过 document.elementFromPoint 检测被遮挡住的下拉菜单对应坐标,返回的 element 也是下拉菜单的子项而不是被劫持的 video

    目前在下拉菜单的点击事件里将 video 元素的 visibility 属性设置为 hidden 或 visible ,暂时解决了菜单被遮挡的问题

    是否有办法检测,这样至少可以只针对这类浏览器做上面的操作(通过 ua 是一种方法,但 安卓上那么多浏览器,也不知道哪些浏览器有这问题)

    2 replies    2022-09-13 21:10:44 +08:00
    xieqiqiang00
        1
    xieqiqiang00  
       Sep 12, 2022
    “低维度生物早期揣测高维度世界规则视频”
    lllyglh
        2
    lllyglh  
       Sep 13, 2022 via Android
    可以用 canvas 播放视频 (不是
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4451 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 04:07 · PVG 12:07 · LAX 21:07 · JFK 00:07
    ♥ Do have faith in what you're doing.