在给hexo装了个插件hexo-blog-encrypt后,
D0n9X1n/hexo-blog-encryptblob/master/ReadMe.zh.md
给文章加密,加密的文章中,
用了下面的代码,第一次点击链接会在当前标签页打开,点击返回后,再次点击链接会在新标签页打开。有什么好办法解决吗?
<script>
document.addEventListener('DOMContentLoaded', function() {
const links = document.querySelectorAll('a');
links.forEach(link => {
link.setAttribute('target', '_blank');
link.setAttribute('rel', 'noopener noreferrer'); // 增加安全性
});
});
</script>