Skip to content

Commit da476ff

Browse files
ChinaGodManoutslept
andcommitted
feat: 屏蔽更多页面的Copilot
Co-authored-by: outslept <webeugene@proton.me>
1 parent 8e99f52 commit da476ff

3 files changed

Lines changed: 37 additions & 4 deletions

File tree

github-no-copilot/AUTHORS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!---->
2+
<!--AUTHORS-->
3+
<!--AUTHORS-END-->
4+
<!--OTHERS-->
5+
[outslept/userscripts](https://github.com/outslept/userscripts/blob/master/dont-wanna-see-copilot/userscript.js)
6+
<!--OTHERS-END-->

github-no-copilot/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# **🛠️ GitHub 隐藏 Copilot 更新日志**
2+
3+
### **📅 2025.5.21.1**
4+
5+
**新增**: 从该存储库复制了代码,并添加屏蔽右侧边栏中的Copilot [outslept/userscripts](https://github.com/outslept/userscripts/blob/master/dont-wanna-see-copilot/userscript.js) <br>
6+
7+
---

github-no-copilot/github-no-copilot.user.js

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@
360360
// @compatible qq
361361
// @compatible via
362362
// @compatible brave
363-
// @version 2025.5.19.1
363+
// @version 2025.5.21.1
364364
// @created 2025-05-19 02:19:24
365365
// @downloadURL https://raw.githubusercontent.com/ChinaGodMan/UserScripts/main/github-no-copilot/github-no-copilot.user.js
366366
// @updateURL https://raw.githubusercontent.com/ChinaGodMan/UserScripts/main/github-no-copilot/github-no-copilot.user.js
@@ -371,7 +371,7 @@
371371
* File Created: 2025/05/19,Monday 02:19:25
372372
* Author: 人民的勤务员@ChinaGodMan (china.qinwuyuan@gmail.com)
373373
* -----
374-
* Last Modified: 2025/05/19,Monday 03:27:16
374+
* Last Modified: 2025/05/21,Wednesday 15:53:18
375375
* Modified By: 人民的勤务员@ChinaGodMan (china.qinwuyuan@gmail.com)
376376
* -----
377377
* License: MIT License
@@ -405,12 +405,32 @@ function remove() {
405405
//dashboard 同上css
406406
'.copilot-dashboard-entrypoint',
407407

408-
// 侧边栏
409-
'a[data-analytics-event*="COPILOT"]'
408+
// 左侧边栏
409+
'a[data-analytics-event*="COPILOT"]',
410+
411+
// 右侧边栏
412+
'a[href="/settings/copilot"]',
413+
414+
// commits 页面 询问差异 Copilot
415+
'li[role="menuitem"].prc-ActionList-ActionListItem-uq6I7'
416+
410417
]
411418
selectors.forEach(selector => {
412419
document.querySelectorAll(selector).forEach(element => element.remove())
413420
})
421+
// https://github.com/outslept/userscripts/blob/master/dont-wanna-see-copilot/userscript.js
422+
//! 需要判断的元素
423+
// issue
424+
document.querySelectorAll('div[data-testid="sidebar-section"]').forEach(s => {
425+
if (s.textContent.includes('Development')) s.remove()
426+
})
427+
428+
document.querySelectorAll('.flash-messages .flash-warn').forEach(w => {
429+
if (w.textContent.includes('Copilot')) w.remove()
430+
})
431+
432+
const m = document.querySelector('.flash-messages')
433+
if (m && !m.children.length) m.remove()
414434

415435
// 可自定义开启或者关闭的元素
416436
const ButtonGroup = document.querySelector('#repos-sticky-header [class*=\'ButtonGroup\']')

0 commit comments

Comments
 (0)