diff --git a/src/javadoc/script.js b/src/javadoc/script.js index 6c31444..8e26ead 100644 --- a/src/javadoc/script.js +++ b/src/javadoc/script.js @@ -2,8 +2,14 @@ document.addEventListener('DOMContentLoaded', function () { var anchors = document.getElementsByTagName('a'); var length = anchors.length; for (var i = 0; i < length; i++) { - if (anchors[i].href.indexOf('http://') === 0 || anchors[i].href.indexOf('https://') === 0) { - anchors[i].target = '_blank'; + if (location.protocol === 'http:' || location.protocol === 'https:') { + if (anchors[i].href.indexOf(location.origin) !== 0) { + anchors[i].target = '_blank'; + } + } else { + if (anchors[i].href.indexOf('file:') !== 0) { + anchors[i].target = '_blank'; + } } } }, false);