Agile育成ブログ
未来を変える喜びを
未分類

target=”_blank”


Warning: count(): Parameter must be an array or an object that implements Countable in /home/xs638785/agile-software.site/public_html/wp-content/plugins/rich-table-of-content/functions.php on line 490

リンクをtarget="_blank"で開くと、新しいブラウジングコンテクスト(通常は新しいタブやウィンドウ)でリンク先のページが開きます。しかし、この新しいページは、window.openerプロパティを使用して、元のページのwindowオブジェクトにアクセスすることができます。これは、新しいページが悪意のあるページである場合、セキュリティリスクとなる可能性があります。

そのため、target="_blank"を使用する際には、rel="noopener"またはrel="noreferrer"を追加することで、このセキュリティリスクを軽減することが推奨されています。

rel="noopener"は、新しいページから元のページのwindowオブジェクトへの参照をブロックします。 rel="noreferrer"は、リンク先にHTTPリファラ情報を送信しないようにし、同時にrel="noopener"と同じ効果を持ちます

<a href="https://example.com" target="_blank" rel="noopener noreferrer">Example Link</a>

You cannot copy content of this page