Skip to content

Commit 0b13715

Browse files
committed
调整 Release/Code(ZIP) 的加速源按钮在新标签页打开
1 parent 6be410c commit 0b13715

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

GithubEnhanced-High-Speed-Download.user.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @name:zh-CN Github 增强 - 高速下载
44
// @name:zh-TW Github 增強 - 高速下載
55
// @name:ru Улучшение GitHub – быстрое скачивание
6-
// @version 2.6.23
6+
// @version 2.6.24
77
// @author X.I.U
88
// @description High-speed download of Git Clone/SSH, Release, Raw, Code(ZIP) and other files (Based on public welfare), project list file quick download (☁)
99
// @description:zh-CN 高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件 (公益加速)、项目列表单文件快捷下载 (☁)
@@ -307,7 +307,7 @@
307307
} else {
308308
url = new_download_url[i][0] + href[1]
309309
}
310-
_html += `<a style="${style[0]}" class="btn" href="${url}" title="${new_download_url[i][2]}" rel="noreferrer noopener nofollow">${new_download_url[i][1]}</a>`
310+
_html += `<a style="${style[0]}" class="btn" href="${url}" target="_blank" title="${new_download_url[i][2]}\n\n提示:如果不想要点击链接在前台打开空白新标签页(一闪而过影响体验),\n可以 [鼠标中键] 或 [Ctrl+鼠标左键] 点击加速链接即可在后台打开新标签页!" rel="noreferrer noopener nofollow">${new_download_url[i][1]}</a>`
311311
}
312312
_this.parentElement.nextElementSibling.insertAdjacentHTML('beforeend', _html + '</div>');
313313
});
@@ -337,7 +337,9 @@
337337
url = new_download_url[i][0] + href
338338
}
339339
html_clone_a.href = url
340-
html_clone_a.setAttribute('title', new_download_url[i][2].replaceAll('&#10;','\n'))
340+
html_clone_a.setAttribute('title', new_download_url[i][2].replaceAll('&#10;','\n') + '\n\n提示:如果不想要点击链接在前台打开空白新标签页(一闪而过影响体验),\n可以 [鼠标中键] 或 [Ctrl+鼠标左键] 点击加速链接即可在后台打开新标签页!');
341+
html_clone_a.setAttribute('target', '_blank');
342+
html_clone_a.setAttribute('rel', 'noreferrer noopener nofollow');
341343
html_clone_span.textContent = 'Download ZIP ' + new_download_url[i][1]
342344
_html += html_clone.outerHTML
343345
}
@@ -420,7 +422,7 @@
420422
} else {
421423
url = raw_url[i][0] + href2;
422424
}
423-
_html += `<a href="${url}" title="${raw_url[i][2]}" target="_blank" role="button" rel="noreferrer noopener nofollow" data-size="small" data-variant="default" class="${html.className} XIU2-RF" style="border-radius: 0;margin-left: -1px;">${raw_url[i][1].replace(/ \d/,'')}</a>`
425+
_html += `<a href="${url}" title="${raw_url[i][2]}\n\n提示:如果想要直接下载,可使用 [Alt + 左键] 点击加速按钮或 [右键 - 另存为...]" target="_blank" role="button" rel="noreferrer noopener nofollow" data-size="small" data-variant="default" class="${html.className} XIU2-RF" style="border-radius: 0;margin-left: -1px;">${raw_url[i][1].replace(/ \d/,'')}</a>`
424426
}
425427
if (document.querySelector('.XIU2-RF')) document.querySelectorAll('.XIU2-RF').forEach((e)=>{e.remove()})
426428
html.insertAdjacentHTML('afterend', _html);
@@ -465,7 +467,7 @@
465467
url = raw_url[menu_rawFast][0] + href2;
466468
}
467469

468-
fileElm.insertAdjacentHTML('afterend', `<a href="${url}" download="${Name}" target="_blank" rel="noreferrer noopener nofollow" class="fileDownLink" style="display: none;" title="「${raw_url[menu_rawFast][1]}」&#10;&#10;[Alt + 左键] 或 [右键 - 另存为...] 下载文件。&#10;注意:鼠标点击 [☁] 图标,而不是左侧的文件名!&#10;&#10;${raw_url[menu_rawFast][2]}&#10;&#10;提示:点击浏览器右上角 Tampermonkey 扩展图标 - [ ${raw_url[menu_rawFast][1]} ] 加速源 (☁) 即可切换。">${svg[0]}</a>`);
470+
fileElm.insertAdjacentHTML('afterend', `<a href="${url}" download="${Name}" target="_blank" rel="noreferrer noopener nofollow" class="fileDownLink" style="display: none;" title="「${raw_url[menu_rawFast][1]}」&#10;&#10;[Alt + 左键点击] 或 [右键 - 另存为...] 下载文件。&#10;注意:鼠标点击 [☁] 图标,而不是左侧的文件名!&#10;&#10;${raw_url[menu_rawFast][2]}&#10;&#10;提示:点击浏览器右上角 Tampermonkey 扩展图标 - [ ${raw_url[menu_rawFast][1]} ] 加速源 (☁) 即可切换。">${svg[0]}</a>`);
469471
// 绑定鼠标事件
470472
trElm.onmouseover = mouseOverHandler;
471473
trElm.onmouseout = mouseOutHandler;

0 commit comments

Comments
 (0)