Code Snippet

1
2
3
if (window.history.length === 1) {
    // Do something...
}


References

https://www.sitepoint.com/community/t/find-out-when-page-is-opened-in-new-window-or-new-tab/8910/11