diff options
author | ILikePlayingGames <22475143+ILikePlayingGames@users.noreply.github.com> | 2023-12-22 03:03:40 -0500 |
---|---|---|
committer | ILikePlayingGames <22475143+ILikePlayingGames@users.noreply.github.com> | 2023-12-22 03:03:40 -0500 |
commit | 0a30bdc024931e18ccf282845c1631881e53a90f (patch) | |
tree | 19b21049b8b3ab84589674259f1ca6709ba4f0fe /docs/js | |
parent | 63a30f64cced82d199982770e618bf428fb66940 (diff) | |
download | SkyBlockModWiki-0a30bdc024931e18ccf282845c1631881e53a90f.tar.gz SkyBlockModWiki-0a30bdc024931e18ccf282845c1631881e53a90f.tar.bz2 SkyBlockModWiki-0a30bdc024931e18ccf282845c1631881e53a90f.zip |
Separate mod lists by Minecraft version and open external links in new tab
Diffstat (limited to 'docs/js')
-rw-r--r-- | docs/js/open-in-new-tab.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/js/open-in-new-tab.js b/docs/js/open-in-new-tab.js new file mode 100644 index 0000000..643cf51 --- /dev/null +++ b/docs/js/open-in-new-tab.js @@ -0,0 +1,19 @@ +(function (){ + const IGNORED_PATHS = [] + + for (const ignoredPath of IGNORED_PATHS) { + if (window.location.pathname.match(`(\/${ignoredPath}[\/?].*)`)) { + return; + } + } + + let links = document.getElementsByTagName("a"); + + for (const link of links) { + if (link.hostname !== window.location.hostname) { + link.target = "_blank"; + } + } + + console.debug(`[Open in New Tab] Changed external links to open in new tab.`); +})();
\ No newline at end of file |