Warning: Undefined variable $post in /home/createview/create-view.com/public_html/wp2020/wp-content/themes/createview/functions/head-meta.php on line 12

Warning: Attempt to read property "post_excerpt" on null in /home/createview/create-view.com/public_html/wp2020/wp-content/themes/createview/functions/head-meta.php on line 12

Warning: Undefined variable $post in /home/createview/create-view.com/public_html/wp2020/wp-content/themes/createview/functions/head-meta.php on line 15

Warning: Attempt to read property "post_content" on null in /home/createview/create-view.com/public_html/wp2020/wp-content/themes/createview/functions/head-meta.php on line 15
target=”_blank”は危険だ。慎重に使ってみよう。 | CreateView |兵庫県加古川市・高砂市のホームページ制作会社

target=”_blank”は危険だ。慎重に使ってみよう。

HTML

target=_”blank”について、セキュリティー的に危険だということで、target=”_blank”についての是非が問われている。
そういえば、最近WordPressのエディターで外部リンクを指定すると rel=”noopener”が勝手に付与しているんだけど、なぜなのかなって疑問に思ったことがtarget=”_blank”問題を知るきっかけでした。

そもそもtarget=”_blank”ってなに?

外部リンクをする際に、別ウインドウおよびタブを開いて表示する指示にtarget=”_blank”を使用します。

<a href=”https://oooo.com” target=”_blank”>外部リンク</a>

上記の指示をすることで、https://oooo.comというサイトを別ウインドウで開くという指示になります。

rel=”noopener”をつけよう

簡単にいうとrel=”noopener”をつけないと、元のページが悪い操作をされてしまう恐れがある。

まとめ

target=”_blank”を指定する際には、セットで rel=”noopener”も指定しよう。

<a href=”https://oooo.com” target=”_blank” rel=”noopener”>外部リンク</a>