Annotates CPU/GPU model names on shopping sites with PassMark performance, rank, value, and price.
- Download or clone the repo.
- Open
chrome://extensionsand toggle Developer mode (top-right). - Click Load unpacked and select the project folder (unzipped).
- Visit any page listing CPUs/GPUs (e.g., product pages or search results). Matches will be annotated inline.
Example
Intel Core i5-13500 → Intel Core i5-13500 (31k, ranked 415, value 150.05, $208)
This section focuses only on the regexes and replace/remove commands that determine what gets annotated, so you can quickly see if your use case is covered.
- On first use, SpecLens requests two PassMark pages through its background service worker:
- CPUs:
https://www.cpubenchmark.net/cpu_list.php - GPUs:
https://www.videocardbenchmark.net/gpu_list.php
- CPUs:
- The background script performs
fetchwithcredentials: "omit", bypassing CORS restrictions. - The raw HTML is returned to the content script via
chrome.runtime.sendMessage.
- The HTML is parsed with a
DOMParser, scanning the<table><tbody><tr>rows. - Each row typically has:
- Name (
<td><a>Intel Core i5-13500</a></td>) - Score (e.g.,
31,236) - Rank (e.g.,
415) - Value score (e.g.,
150.05) - Price (e.g.,
$208.17)
- Name (
- For each entry, SpecLens stores a normalized object:
{ "name": "Intel Core i5-13500", "key": "intel core i5-13500", // lowercased normalized key "score": 31236, "rank": 415, "value": 150.05, "price": "$208.17" }
Used to decide if a text node might contain hardware names:
//annotate.js
/(Intel|AMD|Ryzen|Core|Xeon|Celeron|Pentium|Threadripper|GeForce|Radeon|RTX|GTX|RX)\b/iThis ensures we only process nodes that look like CPU/GPU names.
Sliding window of up to 8 tokens; any substring that matches the detection regex above is considered a candidate.
These ensure that product names with trademarks, spacing, or vendor prefixes still match the benchmark table.
/[\u2122\u00AE]/g // remove ™ and ®
/\s+/g // collapse whitespace
/\s*\(R\)|\s*\(TM\)/gi // remove (R) and (TM)
/\s*-\s*/g // normalize spaces around dashes
/^Intel\s+CPU\s+/i // tidy prefixed descriptors
/^AMD\s+CPU\s+/i
/^NVIDIA\s+GPU\s+/i- Remove redundant words like
ProcessororCPUfrom the name. - Allow GPU names without vendor prefix (e.g.,
NVIDIA GeForce RTX 4070→GeForce RTX 4070).
When a match is found, the name is annotated inline with:
(score, ranked X, value Y, $price)
- Benchmark tables (CPU & GPU lists) are fetched and cached for 7 days.
- Clearing extension storage or reloading forces a refresh.
- Matching is exact after normalization (not fuzzy beyond the rules above).
- If PassMark table markup changes, selectors will need updating.
- Price/value data is PassMark’s snapshot, not live retailer info.