// ==UserScript==
// @name GitHub unknown license
// @version 0.1.4
// @description A userscript that adds "unknown license" message in repos with no license set
// @license MIT
// @author Rob Garrison
// @namespace https://github.com/Mottie
// @match https://github.com/*
// @run-at document-idle
// @grant none
// @require https://greasyfork.org/scripts/28721-mutations/code/mutations.js?version=1108163
// @require https://greasyfork.org/scripts/398877-utils-js/code/utilsjs.js?version=1079637
// @icon https://github.githubassets.com/pinned-octocat.svg
// @updateURL https://raw.githubusercontent.com/Mottie/GitHub-userscripts/master/github-unknown-license.user.js
// @downloadURL https://raw.githubusercontent.com/Mottie/GitHub-userscripts/master/github-unknown-license.user.js
// @supportURL https://github.com/Mottie/GitHub-userscripts/issues
// ==/UserScript==
/* global $ on */
(() => {
"use strict";
// Example page with no license
// https://github.com/isaacs/github
const lawIcon = `
`;
const entry = document.createElement("li");
entry.innerHTML = `
${lawIcon} unknown license
`;
function init() {
const summary = $(".numbers-summary");
if (summary && !$(".octicon-law", summary)) {
summary.append(entry.cloneNode(true));
}
}
on(document, "ghmo:container", init);
init();
})();