I have a registration system on my website which uses the common activation email trick. This email simply contains instructions and a link to the activation page on my website. So suppose I registered on the site, opened a new tab to check my emails and then clicked on the link, which will open in another new tab, resulting in two tabs open on the site (of which one is btw still telling them to o check their mail).
Is there a way to get the link in the email to open in the first tab on my website? (Or open a new tab if the previous one was closed or moved to another domain).
Thanks for any help/suggestions!
tab=x (where x=tab number) to the URL to display the specific tab. For example: https://demo.dj-extensions.com/dj-tabs/?tab=4 will open 4th tab on the demo site, you can try changing the number to another one to see how it works.
Best Practices. Most links should not open in a new tab or window by default using the target="_blank" attribute. By keeping the default link behavior, users can then decide for themselves whether to open the page in a new tab or window. Links that open in the same tab or window are also more secure for your users.
Hold down the Ctrl key and click the link. Use the wheel button of your mouse to click the link. Right-click the link and then click Open link in new tab.
On the right side of the URL's address bar, there is an icon with two intertwined diamonds that will appear: Click on the icon to get a pop-up menu that asks, "Allow mail.google.com to open all links?" Select the "Allow" menu option so that the next time an email opens, it will automatically open in Gmail.
You can name your current window/tab with a JavaScript assignment:
<script type="text/javascript">
this.name = "mainWindow";
</script>
Then you use that name as value for the target
attribute in links, like
<a href="nextPage.html" target="mainWindow">...
If mainWindow
does not yet (or no more) exist, it will open in a new tab.
The above stuff does not solve the OP's problem, because for links opened from emails, the target
attribute will usually not be transferred from MUA to browser (except maybe for webmailers, but we cannot rely on this). So I was thinking of some kind of landing page which uses JavaScript to achieve the desired effect:
If this worked, you would only see a second open tab for a moment (case 1), before it closes itself. Yet it is not possible to "close ourselves", as I learned here and here - so in the end there would be a superfluous tab left, which should have been avoided. Seems like it cannot be done, sorry!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With