HomeToolsAbout

Links and Open New Tab

How to link relative to root

<a href="/directory/file.html" target="_blank" rel="noopener noreferrer">Move to root/directory/file</a>

How to create new tab link

// append inside the `a` tag target="_blank" rel="noopener noreferrer" // full tag example <a href="x.com" target="_blank" rel="noopener noreferrer">open-as-new-tab</a>

More on noopener noreferrer

Source

Used to prevent a type of phishing known as tabnabbing

  • exploit that uses the browser's default behavior with target="_blank" to gain partial access to your page through the window.object API
  • With tabnabbing, a page that you link to could cause your page to redirect to a fake login page. This would be hard for most users to notice because the focus would be on the tab that just opened – not the original tab with your page.
AboutContact