Skip to content

Commit

Permalink
Remove hrefs matching window.top hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
neoformit committed Oct 3, 2024
1 parent 75b64d0 commit 2410e44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions webapp/home/templates/home/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@
&& !el.href.includes('https://{{ HOSTNAME }}')
&& !isLabPage()
) {
if (el.href.replace(/\/$/, "") === 'https://usegalaxy.org.au') {
console.log(`Remove href from anchor: ${el.href}`);
if (el.href.startsWith(`https://${window.top.location.host}`)) {
// console.log(`Remove href from anchor: ${el.href}`);
$(el).removeAttr("href");
} else {
console.log(`Set target="_blank" on anchor: ${el.href}`);
// console.log(`Set target="_blank" on anchor: ${el.href}`);
$(el).attr("target", "_blank");
}
}
Expand Down

0 comments on commit 2410e44

Please sign in to comment.