Open external Links in new tab - Impulse theme

Hey lads,

I know about the “_blank” attribute but I can not for the life of me find the files that contains the html I am looking for.

But since I would like to open all external links in a new tab anyways, it would be easier to just make it so all external links open in a new tab.

Does anyone here know their way around the Impulse theme?

Thank you in advance :slightly_smiling_face:

I’ve worked in impulse but it shouldn’t matter the theme. I think you should be able to write a script that runs on page load and adds the target=“_blank” attribute to any link. If you want to post your store url I can request access, duplicate your theme, and mess with it on the duplicate. Or alternatively I can just try to run a script in the console that you should be able to copy/paste in theme.liquid.

Give this a try. In theme.liquid scroll to the end of the body and add this script before the closing body tag ():


//don't copy the body tag or this text, Im just showing you where it goes

Be sure to put the script tags in as well. If you have trouble I can add it for you.

Sick! Worked like a charm, thank you!

I just noticed that it also opens up pretty much all links in new tabs. (Home , About us, Collections, Terms of service etc.)

The following script worked for me:


Seems to works so far! Thank you.

Did you find a solution where it doesn’t open every link in a new tab?