We have some custom code in the Simple theme that I believe was working perfectly until recently. We have a link in our Header.liquid file to take our customers to our external buyer's guide to find parts that fit their vehicle, and then we have a link on that external site to bring them back to our Shopify store. We have the link in Header.liquid set to target="_self" but instead the link opens in a new tab, which is confusing to the customer, especially if they go back and forth a few times and end up with several tabs open. Is there something we're missing or is there a work-around to get this link to open in the same tab and make the experience more seamless?
Solved! Go to the solution
if you check your DOM that link appears to have a target="_blank" not target="_self".
If it worked previously my question is, did you install any apps, lately, that could have change the behaviour of your site?!
Thank you for teaching me something new. It appears that if I go to the webpage in my browser, right-click the page and select "View Page Source", I'm seeing the raw HTML, but if I right-click the link and select "Inspect", then I'm seeing the resulting DOM. Did I say that right? Is there a way to debug further besides trial and error, and is it possible that this behavior was implemented by Shopify? Thanks again. You've been a great help.
This is an accepted solution.
That's right, yes! DOM is manipulated after the page is loaded and it's different from source code.
It could be both, honestly. I've never had Shopify changing my URLs... so it might be an app you've installed or your theme.