定义函数 getGithubId() 获取当前仓库唯一标识,例如:talelin/lin-ui
สคริปต์นี้ไม่ควรถูกติดตั้งโดยตรง มันเป็นคลังสำหรับสคริปต์อื่น ๆ เพื่อบรรจุด้วยคำสั่งเมทา // @require https://update.greasyfork.org/scripts/421765/901113/%E8%8E%B7%E5%8F%96%20Github%20%E5%BD%93%E5%89%8D%E4%BB%93%E5%BA%93%E5%94%AF%E4%B8%80%E6%A0%87%E8%AF%86.js
// ==UserScript== // @name 获取 Github 当前仓库唯一标识 // @namespace https://juzibiji.top/ // @version 1.0.0 // @icon https://cdn.juzibiji.top/img/20210216152424.png // @description 定义函数 getGithubId() 获取当前仓库唯一标识,例如:talelin/lin-ui // @author 桔子 // @match https://github.com/* // @grant none // ==/UserScript== /** * 获取当前仓库唯一标识 */ function getGithubId() { const strArray = location.pathname.split("/"); return `${strArray[1]}/${strArray[2]}`; }