Extension Purpose and Functionality
This Chrome extension, named "Worldguessr Opponent Stats," is designed to enhance the user experience on worldguessr.com by tracking and remembering the opponent player's name during gameplay. It provides a button to fetch and display detailed statistics about the opponent from the official Worldguessr API.
Key Functionalities and API Calls
- DOM Observation: Uses a
MutationObserver to monitor changes in the page's DOM to detect opponent player names dynamically.
- Opponent Name Extraction: Extracts opponent names from elements with the selector
.player-info .player-name, ignoring the user's own name.
- UI Injection: Adds a fixed-position button labeled "Show Opponent Stats" to the top-right corner of the page.
- API Communication: On button click, fetches opponent statistics from
https://api.worldguessr.com/api/eloRank?username={username} using the Fetch API.
const apiUrl = `https://api.worldguessr.com/api/eloRank?username=${encodeURIComponent(username)}`;
const response = await fetch(apiUrl);
- Modal Display: Displays the fetched statistics in a styled modal overlay, including league info, ELO rating, rank, duel wins/losses/ties, and win rate.
Network Activity
- Communicates with the URL:
https://api.worldguessr.com/api/eloRank to retrieve player statistics.
Filesystem and Privilege Activity
- No filesystem access, process execution, shell commands, PowerShell usage, Windows Registry operations, user creation, or clipboard access detected.
Obfuscation
- The code is well-structured, readable, and uses clear variable names. No obfuscation techniques such as string encryption or control flow flattening are present.
Summary
The extension enhances gameplay by providing quick access to opponent stats via an official API. It operates entirely within the browser context without elevated privileges or suspicious behaviors.