Where and why is the rel="noopener" attribute used?
Where and why is the rel="noopener" attribute used?
The rel="noopener" attribute is used in HTML within the <a>, <area>, and <form> elements. It is specifically applied to hyperlinks (defined by the <a> tag) that open a target URL in a new browsing context, such as a new tab or window, which is typically specified using the target="_blank" attribute.
rel="noopener"The primary purpose of the rel="noopener" attribute is to enhance security by preventing the newly opened page from accessing the window.opener property of the page that opened it. This property could otherwise allow the new page to control the original page, leading to potential security risks such as phishing attacks. By setting window.opener to null, the rel="noopener" attribute effectively severs any connection between the two pages, ensuring that the originating document remains secure from potential malicious tampering by the opened page.
Đăng nhập để tham gia thảo luận cùng mọi người.
Chưa có bình luận nào
Hãy là người đầu tiên chia sẻ suy nghĩ của bạn.