Skip to content

Instantly share code, notes, and snippets.

@JJTech0130
Last active June 16, 2022 16:23
Show Gist options
  • Save JJTech0130/054e45e08578043d96bf1742afb4c248 to your computer and use it in GitHub Desktop.
Save JJTech0130/054e45e08578043d96bf1742afb4c248 to your computer and use it in GitHub Desktop.
Greasemonkey script that moves labels on GitHub issues in front of the title
// ==UserScript==
// @name GitHub Labels Fixup
// @namespace https://jjtech.dev
// @description Moves labels on GitHub issues in front of the title
// @version 4.3
// @require https://code.jquery.com/jquery-3.6.0.slim.min.js
// @match https://github.com/*
// @icon https://github.githubassets.com/pinned-octocat.svg
// @inject-into content
// ==/UserScript==
function updateIssueLabels() {
$('.IssueLabel').each(function(i, obj) {
$(obj).parent().insertBefore($(obj).parent().prev())
});
}
updateIssueLabels()
document.addEventListener("pjax:end", updateIssueLabels)
@JJTech0130
Copy link
Author

JJTech0130 commented Jun 15, 2022

Click here to install it.

@JJTech0130
Copy link
Author

JJTech0130 commented Jun 15, 2022

Changelog

Version 4.3

  • Fix an issue with GitHub's CSP when using Safari

Version 4.2

  • Loosen the match, so that it still applies when the initial page you visit is not an issues page.

Version 4.1

  • Fix the icon
  • Add support for PRs (in addition to Issues)

Version 4.0

  • Fix an issue where it does not trigger when changing tabs in GitHub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment