Skip to content

Web 安全 #32

@itboos

Description

@itboos

安全相关:

rel=noopener 解决了什么问题?

当你使用 target='_blank' 打开一个新的标签页时,新页面的 window 对象上有一个属性 opener,
它指向的是前一个页面的 window 对象,因此,后一个页面就获得了前一个页面的控制权,so 可怕!!

解决方案:

 <a href=""  target='_blank'    rel="noreferrer noopener">我是 a 链接</a>

demo 栗子

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions