Skip to content

Commit

Permalink
fix(github): only sponsoring tab will be effected
Browse files Browse the repository at this point in the history
  • Loading branch information
leedom92 committed Mar 27, 2024
1 parent 7c5e1b0 commit f9f9773
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "You-Dont-Need-Useless-Dom",
"version": "1.2.0",
"version": "1.3.1",
"description": "There is a lot of dom that we may not wanna look at.",
"homepage_url": "https://github.com/leedom92/You-Dont-Need-Useless-Dom",
"icons": {
Expand Down
16 changes: 15 additions & 1 deletion extension/scripts/github.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
// window.onload = () => {
// const PAST_SPONSORSHIP = document.getElementsByClassName('Label--secondary')

// if (PAST_SPONSORSHIP?.length) {
// for (const dom of PAST_SPONSORSHIP) {
// dom.style.backgroundColor = '#bf3989'
// dom.style.border = '#bf3989'
// dom.style.color = '#fff'
// }
// }
// }

// 监听是否有新dom插入
document.addEventListener('DOMNodeInserted', function() {
const PAST_SPONSORSHIP = document.getElementsByClassName('Label--secondary')

if (PAST_SPONSORSHIP?.length) {
const search = window.location.search

if (PAST_SPONSORSHIP?.length && search === '?tab=sponsoring') {
for (const dom of PAST_SPONSORSHIP) {
dom.style.backgroundColor = '#bf3989'
dom.style.border = '#bf3989'
Expand Down

0 comments on commit f9f9773

Please sign in to comment.