Skip to content

Conversation

@sirschubert
Copy link
Contributor

@sirschubert sirschubert commented Dec 24, 2025

Description

This PR significantly refines the HackTheBox activity to support the website's latest structural changes (SPA routing) and introduces high-efficiency logic for dynamic asset rendering.

Key Changes:

Architectural Overhaul: Replaced the O(n) regex-loop routing with a high-speed switch-based router, reducing processing overhead during DOM updates.

User Identity Integration: Implemented a targeted scraper to display the operative's username (Username: {name}) on the homepage instead of a generic "Homepage" string.

Dynamic Asset Scraping:

Added support for Machine Avatars: The presence now dynamically scrapes the Machine's unique avatar URL from the HTB S3 bucket when viewing a specific machine page.

Implemented a specificity-hardened selector (.avatar-icon-name-details) to prevent accidental scraping of the user's profile picture.

Asset Logic: Introduced smallImageKey support for specific sections (Tracks, Fortresses, Challenges, etc.) utilizing a centralized asset map.

Routing Logic: Consolidated redundant state-checkers into a single getBrowsingState helper that dynamically reads ?tab= query parameters.

Settings Integration: Added support for user-configurable toggles for Rank, Global Ranking, and Flags on the Dashboard via PresenceSettings.

Type Safety: Resolved TypeScript union-type conflicts (PresenceData vs MediaPresenceData) using explicit type casting for more robust builds.

Acknowledgements

Screenshots

Proof showing the creation/modification is working as expected image image image

@sirschubert sirschubert force-pushed the fix/hackthebox-update branch from b25664a to 52ae821 Compare December 25, 2025 03:38
@sirschubert sirschubert force-pushed the fix/hackthebox-update branch from cb960e9 to 91a77c1 Compare December 25, 2025 08:11
@sirschubert sirschubert changed the title fix(HackTheBox): Update selectors, add settings, fix routing logic fix(hackthebox): Update selectors, add settings, fix routing logic Dec 25, 2025
Signed-off-by: sirschubert <100043392+sirschubert@users.noreply.github.com>
Copy link
Member

@Bas950 Bas950 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump version in metadata

and maybe use a Promise.all for the getSetting calls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants