// ==UserScript== // @name github-ossinsight // @namespace https://github.com/lly-ke/github-ossinsight // @version 2022.12.20 // @description Add ossinsight jump button to github repository to quickly analyze the health of an open source project for multi-dimensional insight into an open source project // @description:zh github 仓库中添加 ossinsight 跳转按钮, 快速分析开源项目健康状况以便多维度深入探究一个开源项目 // @description:zh-CN github 仓库中添加 ossinsight 跳转按钮, 快速分析开源项目健康状况以便多维度深入探究一个开源项目 // @author lly-ke // @match https://github.com/* // @icon https://raw.githubusercontent.com/lly-ke/github-ossinsight/main/images/logo.png // @grant none // @license // @downloadURL none // ==/UserScript== (function () { 'use strict' const svgStr = ` ` const el = document.querySelector('.pagehead-actions') const [owner, repo] = location.pathname.split('/').slice(1, 3) const targetUrl = `https://ossinsight.io/analyze/${owner}/${repo}` const title = `${repo} 仓库对应的 ossinsight 分析页面` if (!el) { console.log('github-ossinsight: 没有找到pagehead-actions元素, 无法添加按钮') return } el.insertAdjacentHTML( 'afterbegin', `