当前位置:网站首页>对于在新标签页中打开的链接,始终使用“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"`避免旧旧浏览器中的安全和性能问题。边栏推荐
- 用virtualenv和Virtualenvwrapper虚拟环境管理工具创建虚拟环境
- SRv6 L3VPN的工作原理
- 将vim与系统剪贴板的交互使用
- System availability: 3 9s, 4 9s in SRE's mouth... What is it?
- 联邦学习入门
- Interpretation of the paper (GSAT) "Interpretable and Generalizable Graph Learning via Stochastic Attention Mechanism"
- [深入研究4G/5G/6G专题-48]: 5G Link Adaption链路自适应-4-下行链路自适应DLLA-PDCCH信道
- perspectiveTransform warpPerspective getPerspectiveTransform findHomography
- PDF转Word有那么难吗?做一个文件转换器,都解决了
- 小程序毕设作品之微信美食菜谱小程序毕业设计成品(8)毕业设计论文模板
猜你喜欢

Use Jenkins for continuous integration, this knowledge point must be mastered

Prufer序列

联邦学习的框架搭建

文件查询匹配神器 【glob.js】 实用教程

【数据分析03】

From 0 to 100: Notes on the Development of Enrollment Registration Mini Programs

How to add a game character to a UE4 scene

深度学习Course2第二周Optimization Algorithms习题整理

cmd指令

简单3D渲染器的制作
随机推荐
Still struggling with reporting tool selection?To take a look at this
excel cell contian two words, seperated by a slash
excel split text into different rows
联邦学习的框架搭建
美赞臣EDI 940仓库装运订单详解
下载安装 vscode(含汉化、插件的推荐和安装)
PHP算法之有效的括号
PAM Palindromic Automata
【Verilog刷题篇】硬件工程师从0到入门1|基础语法入门
NgRx Selector 的 Memoization 特性学习笔记
03、GO语言变量定义、函数
部门项目源码分享
prim生成树
如何理解 new (...args: any[]) => any
10年稳定性保障经验总结,故障复盘要回答哪三大关键问题?|TakinTalks大咖分享
浅析多服务在分布式系统下多事务通信处理机制方案
【数据分析03】
【参营经历贴】2022网安夏令营
JS prototype hasOwnProperty in Add method Prototype end point Inherit Override parent class method
华为无线设备配置双链路冷备份(AP指定配置方式)