|
3 | 3 | // @name:zh-CN Github 增强 - 高速下载 |
4 | 4 | // @name:zh-TW Github 增強 - 高速下載 |
5 | 5 | // @name:ru Улучшение GitHub – быстрое скачивание |
6 | | -// @version 2.6.36 |
| 6 | +// @version 2.6.37 |
7 | 7 | // @author X.I.U |
8 | 8 | // @description High-speed download of Git Clone/SSH, Release, Raw, Code(ZIP) and other files (Based on public welfare), project list file quick download (☁) |
9 | 9 | // @description:zh-CN 高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件 (公益加速)、项目列表单文件快捷下载 (☁) |
|
264 | 264 | for (const target of mutation.addedNodes) { |
265 | 265 | if (target.nodeType !== 1) return |
266 | 266 | if (target.tagName === 'DIV' && target.parentElement && target.parentElement.id === '__primerPortalRoot__') { |
267 | | - addDownloadZIP(target); |
268 | 267 | addGitClone(target); |
269 | 268 | addGitCloneSSH(target); |
| 269 | + addDownloadZIP(target); |
| 270 | + //setTimeout(()=>{addDownloadZIP(target)}, 300); |
270 | 271 | } else if (target.tagName === 'DIV' && target.className.indexOf('LocalTab-module__') != -1) { |
271 | 272 | if (target.querySelector('input[value^="https:"]')) { |
272 | 273 | addGitCloneClear('.XIU2-GCS'); addGitClone(target); |
|
325 | 326 |
|
326 | 327 | // Download ZIP |
327 | 328 | function addDownloadZIP(target) { |
328 | | - let html = target.querySelector('ul[class^=prc-ActionList-ActionList-]>li:last-child');if (!html) return |
329 | | - let href_script = document.querySelector('react-partial[partial-name=repos-overview]>script[data-target="react-partial.embeddedData"]'), |
330 | | - href_slice = href_script.textContent.slice(href_script.textContent.indexOf('"zipballUrl":"')+14), |
331 | | - href = href_slice.slice(0, href_slice.indexOf('"')), |
332 | | - url = '', _html = '', new_download_url = get_New_download_url(); |
| 329 | + const html = target.querySelector('ul[class^=prc-ActionList-ActionList-]>li:last-child');if (!html) return |
| 330 | + let href = html.querySelector('a[href^="/"][href$=".zip"]');if (!href || !href.getAttribute('href')) return |
| 331 | + href = href.getAttribute('href'); |
| 332 | + //const href_script = document.querySelector('react-partial[partial-name=repos-overview]>script[data-target="react-partial.embeddedData"]');if (!href_script) return |
| 333 | + //const href = JSON.parse(href_script.textContent).props.initialPayload.overview.codeButton.local.platformInfo.zipballUrl |
| 334 | + /*let href_slice = href_script.textContent.slice(href_script.textContent.indexOf('"zipballUrl":"')+14), |
| 335 | + href = href_slice.slice(0, href_slice.indexOf('"')),*/ |
| 336 | + let url = '', _html = '', new_download_url = get_New_download_url(); |
333 | 337 |
|
334 | 338 | // 克隆原 Download ZIP 元素,并定位 <a> <span> 标签 |
335 | 339 | let html_clone = html.cloneNode(true), |
|
0 commit comments