Created
December 16, 2024 15:36
-
-
Save austinlparker/73eff5d7d99ec3eac79f9315916bf8b2 to your computer and use it in GitHub Desktop.
hide reposts in bluesky following feed (arc boost/userscript)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// replace the <USER DISPLAY NAME> with the display name of the user you wish to hide reposts from in your following feed | |
function processElements() { | |
document.querySelectorAll('[aria-label="Reposted by <USER DISPLAY NAME>"]').forEach(element => { | |
let parent = element.parentElement; | |
while (parent) { | |
if (parent.tagName === 'DIV' && !parent.className) { | |
parent.className = 'hide'; | |
break; | |
} | |
parent = parent.parentElement; | |
} | |
}); | |
} | |
const observer = new MutationObserver(mutations => { | |
for (const mutation of mutations) { | |
mutation.addedNodes.forEach(node => { | |
if (node.nodeType === Node.ELEMENT_NODE) { | |
processElements(); | |
} | |
}); | |
} | |
}); | |
observer.observe(document.body, { | |
childList: true, | |
subtree: true | |
}); | |
processElements(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment