24 lines
957 B
JavaScript
24 lines
957 B
JavaScript
var excludedClasses = ['talks_comments','tiaozhuan-button', 'floating-tools'];
|
|
window.addEventListener('load', function() {
|
|
document.body.addEventListener('click', function(e) {
|
|
var target = e.target.closest('a');
|
|
if (!target) return;
|
|
|
|
if (target.href.startsWith('javascript:') ||
|
|
target.hostname === window.location.hostname ||
|
|
target.href.includes('usj.cc') ||
|
|
target.href.includes('douban.com') ||
|
|
target.href.includes('bilibili.com') ||
|
|
target.href.includes('github.com') ||
|
|
target.href.includes('zql.im') ||
|
|
target.href.includes('5b2.cn') ||
|
|
target.href.includes('beian.miit.gov.cn') ||
|
|
target.href.includes('upyun.com')) return;
|
|
|
|
if (excludedClasses.some(function(cn) { return target.classList.contains(cn); })) return;
|
|
|
|
e.preventDefault();
|
|
var encodedUrl = btoa(target.href);
|
|
window.open('/tiaozhuan.html?target=' + encodedUrl, '_blank');
|
|
});
|
|
}); |