当前位置:网站首页>对于在新标签页中打开的链接,始终使用“noopener”或“noreferrer”
对于在新标签页中打开的链接,始终使用“noopener”或“noreferrer”
2022-08-01 23:03:00 【紫微前端】
`target="_blank"`
属性。但是,如果您不了解它们,它可能会导致一些问题。`window`
开启页面的`window.opener`
对象。假设新选项卡执行以下代码:window.opener.location = 'http://fake.website.here';
`rel="noopener"`
修复问题。`rel="noreferrer"`
属性。它不仅修复了`noopener`
确实存在的问题,而且还阻止了`Referer`
标题被发送到新选项卡。<!-- Don't -->
<a target="_blank">...</a>
<!-- Do -->
<a target="_blank" rel="noopener">...</a>
<!-- Or -->
<a target="_blank" rel="noreferrer">...</a>
<a target="_blank" rel="noopener noreferrer">...</a>
`noopener`
缺少该行为时自动添加该行为。但是,仍然建议添加`rel="noopener"`
或`rel="noreferrer"`
避免旧旧浏览器中的安全和性能问题。边栏推荐
- excel change cell size
- 关于ETL的两种架构(ETL架构和ELT架构)
- 【Verilog刷题篇】硬件工程师从0到入门1|基础语法入门
- 【SeaTunnel】从一个数据集成组件演化成企业级的服务
- SQL Server (design database--stored procedure--trigger)
- PAM Palindromic Automata
- bat 之 特殊字符&转义
- APP special test: traffic test
- The must-have "fishing artifact" for programmers is here!
- Deep learning Course2 first week Practical aspects of Deep Learning exercises
猜你喜欢
Wechat Gymnasium Reservation Mini Program Graduation Design Finished Work Mini Program Graduation Design Finished Product (2) Mini Program Function
blender3.2.1 unit setting
Small application project works WeChat stadium booking applet graduation design of the finished product (1) the development profile
cmd指令
小程序毕设作品之微信体育馆预约小程序毕业设计成品(4)开题报告
CAKE:一个用于多视图知识图谱补全的可扩展性常识感知框架
【参营经历贴】2022网安夏令营
xctf attack and defense world web master advanced area webshell
Go 微服务开发框架DMicro的设计思路
Use Jenkins for continuous integration, this knowledge point must be mastered
随机推荐
【Verilog刷题篇】硬件工程师从0到入门1|基础语法入门
深度学习Course2第一周Practical aspects of Deep Learning习题整理
Prufer sequence
从0到1:图文投票小程序设计与研发笔记
xctf攻防世界 Web高手进阶区 webshell
SAP Spartacus NgExpressEngineDecorator 的工作原理
1391D. 505 状压dp
Use Jenkins for continuous integration, this knowledge point must be mastered
E - Integer Sequence Fair
Additional Features for Scripting
Oracle 数据库设置为只读及读写
How to use pywinauto and pyautogui to link the anime lady and sister please go home
基于JAX的激活函数、softmax函数和交叉熵函数
三、mysql 存储引擎-建库建表操作
力扣第 304 场周赛复盘
excel vertical to horizontal
SQL Server(设计数据库--存储过程--触发器)
Deep Learning Course2 Week 2 Optimization Algorithms Exercises
excel change cell size
小程序毕设作品之微信体育馆预约小程序毕业设计成品(3)后台功能