mirror of
https://github.com/XIU2/UserScript.git
synced 2026-09-07 11:27:41 +00:00
调整 Release/Code(ZIP) 的加速源按钮在新标签页打开
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
// @name:zh-CN Github 增强 - 高速下载
|
||||
// @name:zh-TW Github 增強 - 高速下載
|
||||
// @name:ru Улучшение GitHub – быстрое скачивание
|
||||
// @version 2.6.23
|
||||
// @version 2.6.24
|
||||
// @author X.I.U
|
||||
// @description High-speed download of Git Clone/SSH, Release, Raw, Code(ZIP) and other files (Based on public welfare), project list file quick download (☁)
|
||||
// @description:zh-CN 高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件 (公益加速)、项目列表单文件快捷下载 (☁)
|
||||
@@ -307,7 +307,7 @@
|
||||
} else {
|
||||
url = new_download_url[i][0] + href[1]
|
||||
}
|
||||
_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>`
|
||||
_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>`
|
||||
}
|
||||
_this.parentElement.nextElementSibling.insertAdjacentHTML('beforeend', _html + '</div>');
|
||||
});
|
||||
@@ -337,7 +337,9 @@
|
||||
url = new_download_url[i][0] + href
|
||||
}
|
||||
html_clone_a.href = url
|
||||
html_clone_a.setAttribute('title', new_download_url[i][2].replaceAll(' ','\n'))
|
||||
html_clone_a.setAttribute('title', new_download_url[i][2].replaceAll(' ','\n') + '\n\n提示:如果不想要点击链接在前台打开空白新标签页(一闪而过影响体验),\n可以 [鼠标中键] 或 [Ctrl+鼠标左键] 点击加速链接即可在后台打开新标签页!');
|
||||
html_clone_a.setAttribute('target', '_blank');
|
||||
html_clone_a.setAttribute('rel', 'noreferrer noopener nofollow');
|
||||
html_clone_span.textContent = 'Download ZIP ' + new_download_url[i][1]
|
||||
_html += html_clone.outerHTML
|
||||
}
|
||||
@@ -420,7 +422,7 @@
|
||||
} else {
|
||||
url = raw_url[i][0] + href2;
|
||||
}
|
||||
_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>`
|
||||
_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>`
|
||||
}
|
||||
if (document.querySelector('.XIU2-RF')) document.querySelectorAll('.XIU2-RF').forEach((e)=>{e.remove()})
|
||||
html.insertAdjacentHTML('afterend', _html);
|
||||
@@ -465,7 +467,7 @@
|
||||
url = raw_url[menu_rawFast][0] + href2;
|
||||
}
|
||||
|
||||
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]}」 [Alt + 左键] 或 [右键 - 另存为...] 下载文件。 注意:鼠标点击 [☁] 图标,而不是左侧的文件名! ${raw_url[menu_rawFast][2]} 提示:点击浏览器右上角 Tampermonkey 扩展图标 - [ ${raw_url[menu_rawFast][1]} ] 加速源 (☁) 即可切换。">${svg[0]}</a>`);
|
||||
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]}」 [Alt + 左键点击] 或 [右键 - 另存为...] 下载文件。 注意:鼠标点击 [☁] 图标,而不是左侧的文件名! ${raw_url[menu_rawFast][2]} 提示:点击浏览器右上角 Tampermonkey 扩展图标 - [ ${raw_url[menu_rawFast][1]} ] 加速源 (☁) 即可切换。">${svg[0]}</a>`);
|
||||
// 绑定鼠标事件
|
||||
trElm.onmouseover = mouseOverHandler;
|
||||
trElm.onmouseout = mouseOutHandler;
|
||||
|
||||
Reference in New Issue
Block a user