superfatboy

如何自定义浏览器的默认 confirm

  •  
  •   superfatboy · Dec 17, 2021 · 1906 views
    This topic created in 1616 days ago, the information mentioned may be changed or developed.

    偶然发现 Twitter 登录 会弹出这个,貌似使用的是浏览器的弹框,以为是使用 window.confirm ,但是发现与 confirm 的又不太一样,像是一个自定义的 confirm ,这个是怎么做到的?

    TF0MXF.png

    6 replies    2021-12-18 19:18:07 +08:00
    eason1874
        1
    eason1874  
       Dec 17, 2021
    应该是 JS + CSS 做的
    Biwood
        2
    Biwood  
       Dec 17, 2021   ❤️ 2
    这个就是原生的登录接口,没有 CSS 和 JS ,不是基于 windows.confirm ,而是通过在 HTTP 头部添加 WWW-Authenticate 字段,并返回 401 状态码

    参考 https://www.php.net/manual/en/features.http-auth.php
    superfatboy
        3
    superfatboy  
    OP
       Dec 17, 2021
    @eason1874 应该不是,他这个层级能超出收藏夹,如果是使用 js 和 css 自定义的那种,怎么也不可能超出浏览器的可视范围吧!
    [![TFcmVS.png]( https://s4.ax1x.com/2021/12/17/TFcmVS.png)]( https://imgtu.com/i/TFcmVS)
    superfatboy
        4
    superfatboy  
    OP
       Dec 17, 2021
    @Biwood 长知识了
    superfatboy
        6
    superfatboy  
    OP
       Dec 18, 2021
    @phy25 你这个貌似是对啊,http auto 我尝试了一下,弹出来的都是用户 /密码输入框
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   915 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 21:17 · PVG 05:17 · LAX 14:17 · JFK 17:17
    ♥ Do have faith in what you're doing.