Changed download url to cover commits as well

This commit is contained in:
George Sokianos 2022-06-04 23:10:09 +01:00
parent 23b694502d
commit 3b208e1b12
1 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
// GitHub CSS fixes
// version 1.1
// 2022-04-04
// version 1.2
// 2022-06-04
// 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.1 (04.04.2022)
// @version $VER: GitHub CSS fixes 1.2 (04.06.2022)
// @url https://ko-fi.com/walkero
// ==/UserScript==
@ -76,11 +76,11 @@ window.onload = function () {
var archiveUrl = canonicalUrl;
if (canonicalUrl.indexOf("tree") > -1) {
archiveUrl = archiveUrl.replace("tree", "archive/refs/heads");
archiveUrl = archiveUrl.replace("tree", "archive");
} else {
var branchElem = document.querySelector("span[data-menu-button]");
if (branchElem !== null) {
archiveUrl += "/archive/refs/heads/" + branchElem.textContent;
archiveUrl += "/archive/" + branchElem.textContent;
}
}