From c1c96806ff6e4efe26916ede480338516d6a0b09 Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Wed, 8 Feb 2023 15:16:49 +0000 Subject: [PATCH] Fixed the assets link in releases --- github.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/github.js b/github.js index a4bbff3..509933f 100644 --- a/github.js +++ b/github.js @@ -1,6 +1,6 @@ // GitHub CSS fixes -// version 1.4 -// 2022-11-25 +// version 1.5 +// 2023-02-08 // Copyright (c) 2021 Created by Georgios Sokianos // Released under the GPL license // http://www.gnu.org/copyleft/gpl.html @@ -10,7 +10,7 @@ // @namespace none // @description Fixes css in GitHub // @include https://github.com/* -// @version $VER: GitHub CSS fixes 1.4 (25.11.2022) +// @version $VER: GitHub CSS fixes 1.5 (08.02.2023) // @url https://ko-fi.com/walkero // ==/UserScript== @@ -84,7 +84,7 @@ window.onload = function () { var container = document.getElementById("repository-container-header"); var archiveText = document.createTextNode("Download ZIP"); var archiveUrl = canonicalUrl; - + if (canonicalUrl.indexOf("tree") > -1) { archiveUrl = archiveUrl.replace("tree", "archive"); } else { @@ -93,19 +93,19 @@ window.onload = function () { archiveUrl += "/archive/" + branchElem.textContent; } } - + if (archiveUrl != canonicalUrl) { var archiveLink = document.createElement("a"); archiveLink.appendChild(archiveText); archiveLink.title = "Download as a ZIP file"; archiveLink.href = archiveUrl + ".zip"; - + container.appendChild(archiveLink); } } // Add assets URL in a release - var fragment = document.querySelector("include-fragment[data-test-selector='lazy-asset-list-fragment']"); + var fragment = document.querySelector("include-fragment[loading='lazy']"); if (fragment !== null) { var assetUrl = fragment.getAttribute('src'); if (assetUrl !== null) { @@ -114,7 +114,7 @@ window.onload = function () { assetLink.appendChild(assetUrlText); assetLink.title = "List of assets"; assetLink.href = assetUrl; - + fragment.appendChild(assetLink); } }