I'm implementing a "Go Back" button that redirect the user to the previous page or close the current tab if the page is opened in a new tab.
How can i detect (server side or client side) if the page is opened in a new tab ?
My solution is to pass a parameter (for exemple "new_tab=1"
) in every href
attribute of each <a>
tag with target="_blank"
so i can read that parameter in the page load event, but i hope in a quicker solution.