💄 Add extend URL display style.

This commit is contained in:
凡梦星尘
2022-06-19 14:53:12 +08:00
parent 00c93d2fb7
commit f155ded3e0
6 changed files with 13 additions and 21 deletions

View File

@@ -23,22 +23,6 @@ HTMLElement.prototype.wrap = function(wrapper) {
NexT.utils = {
registerExtURL: function() {
document.querySelectorAll('span.exturl').forEach(element => {
const link = document.createElement('a');
// https://stackoverflow.com/questions/30106476/using-javascripts-atob-to-decode-base64-doesnt-properly-decode-utf-8-strings
link.href = decodeURIComponent(atob(element.dataset.url).split('').map(c => {
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
}).join(''));
link.rel = 'noopener external nofollow noreferrer';
link.target = '_blank';
link.className = element.className;
link.title = element.title;
link.innerHTML = element.innerHTML;
element.parentNode.replaceChild(link, element);
});
},
/**
* One-click copy code support.
*/