I want my external links to open in a new tab

I think @jeff’s version expects jQuery to be present, here’s a vanilla JavaScript version:

[...document.querySelectorAll("a[href*='?xgtab&']")].forEach(link => {
	link.setAttribute("target", "moredetail");
});
4 Likes