Last active
March 28, 2024 17:18
-
-
Save n0099/2b440ad774406030dc72699da6bba2bc to your computer and use it in GitHub Desktop.
This file contains 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
// run in F12-Console under https://steamcommunity.com/id/${yourUsername}/home/ | |
// more about friend activity: https://steamcommunity.com/sharedfiles/filedetails/?id=835308111 | |
let steamID64 = '0'; // https://developer.valvesoftware.com/wiki/SteamID MUST BE WARPPED IN 'STRING' TO PREVENT IEEE754 related issues https://en.wikipedia.org/wiki/Nominal_number | |
const removeElements = () => { | |
jQuery(`div.blotter_block a:not([href="https://steamcommunity.com/profiles/${steamID64}"])`) | |
.parents('div.blotter_block') | |
// parent elements that contain any <a href=""> not linking to user profile | |
// are also including ones that contain the link to the user profile | |
// so we need to exclude them | |
.not(jQuery(`div.blotter_block a[href="https://steamcommunity.com/profiles/${steamID64}"]`) | |
.parents('div.blotter_block')) | |
.remove(); | |
jQuery(`div.blotter_daily_rollup_line a:not([href="https://steamcommunity.com/profiles/${steamID64}"])`) | |
.parents('div.blotter_daily_rollup_line') | |
.not(jQuery(`div.blotter_daily_rollup_line a[href="https://steamcommunity.com/profiles/${steamID64}"]`) | |
.parents('div.blotter_daily_rollup_line')) | |
.remove(); | |
jQuery('div.blotter_daily_rollup_line_groups').remove(); | |
}; | |
removeElements(); | |
window.specificFriendActivityMutationObserver = new MutationObserver(removeElements); // listen to infinite scroll triggered updates | |
specificFriendActivityMutationObserver.observe(jQuery('div#blotter_content')[0], {childList: true}); | |
// stop further listening: specificFriendActivityMutationObserver.disconnect(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment