您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
在 Github 网站顶部分别显示 github1s.com 和github.dev按钮,支持项目进行在线编辑
当前为
// ==UserScript== // @name 显示github编辑按钮按钮 // @icon https://github.com/favicons/favicon-codespaces.svg // @namespace https://github.com/gclm // @version 1.0.2 // @description 在 Github 网站顶部分别显示 github1s.com 和github.dev按钮,支持项目进行在线编辑 // @author gclm // @match https://github.com/* // @grant none // @require https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.slim.min.js // @license. // ==/UserScript== (function () { 'use strict'; createButton(); $(document).on("pjax:end", ()=>{ createButton(); }); })(); /** * 创建 Github.dev 按钮 */ function createButton() { const github1sButton = document.querySelector("#github1sButton"); const githubDevButton = document.querySelector("#githubDevButton"); if (github1sButton !== null || githubDevButton != null) { return; } const githubd1sUrl = `https://github1s.com${location.pathname}`; const githubdevUrl = `https://github.dev${location.pathname}`; const githubd1sElement = '<li id="github1sButton"> <a target="_blank" class="btn btn-sm" href="' + githubd1sUrl + '"> <img class="icon octicon octicon-heart text-pink" src="https://github.com/favicons/favicon-codespaces.svg" /> Github1s </a> </li>'; const githubdevElement = '<li id="githubDevButton"> <a target="_blank" class="btn btn-sm" href="' + githubdevUrl + '"> <img class="icon octicon octicon-heart text-pink" src="https://github.com/favicons/favicon-codespaces.svg" /> GithubDev </a> </li>'; const node = document.querySelector('.pagehead-actions.flex-shrink-0.d-none.d-md-inline'); if(node !== null){ node.insertAdjacentHTML('afterBegin', githubd1sElement); node.insertAdjacentHTML('afterBegin', githubdevElement); } }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址