English | 中文 | Español | Français | Português | Русский | 日本語 | Deutsch | Українська | Polski | Nederlands | Қазақша | Svenska | Čeština
Extract Google Play bundle IDs and App Store App IDs from raw page HTML — entirely client-side, with zero network calls, zero build step, and zero dependencies.
Note
Scope of this document. This repository is a static, browser-native application-style utility — not a server-side service and not an embeddable logging library. This README follows a standardized, exhaustive open-source layout (architecture, testing, deployment, configuration, edge cases) and documents every exported function, regex contract, storage key, and failure mode in the codebase. The core extraction layer (assets/js/parser.js) is DOM-free and therefore importable as a plain ES module in any Node.js or bundler-based environment — see Programmatic API.
- Features
- Tech Stack & Architecture
- Getting Started
- Testing
- Deployment
- Usage
- Configuration
- License
- Support the Project
- Google Play extraction — recovers package names from any
/store/apps/details?id=…URL shape: absoluteplay.google.comlinks, root-relative links, links with query parameters beforeid=, and HTML-escaped variants (&). - App Store extraction — recovers numeric App IDs from three independent URL shapes:
apps.apple.com/…/app/…/id123…,itunes.apple.comlinks, and theitms-apps://deep-link scheme used in emails and third-party pages. - Source fingerprinting — classifies the pasted document as Google Play, App Store, both, or neither via
detectSources(), so users immediately know if they copied the wrong page. - Order-preserving deduplication —
uniqPreserveOrder()collapses duplicates withSet-backedO(n)semantics while keeping the first-seen position, so exported lists mirror the visual order of the source page. - Dual counters per result set — reports both raw matches in the HTML (
allCount) and unique IDs (uniq.length), exposing multi-pattern double-counting instead of hiding it. - Client-side filtering & sorting — live substring filter (case-insensitive) plus three sort modes — As found, A → Z, Z → A — applied per card without mutating the underlying result set.
- Multi-format export —
.txt(newline-delimited),.csv(idheader, quoted values, CRLF line endings), and.json(pretty-printed array, 2-space indent). - Clipboard integration — one-click copy of the visible (filtered/sorted) list, with a
document.execCommand('copy')fallback for non-secure contexts and denied permissions. - Flexible HTML intake — paste, clipboard read, file upload (
.html,.htm,.txt), or drag-and-drop onto the editor — capped at 10 MB on the file path. - Auto-parse mode — 350 ms debounced re-parse on every keystroke; toggleable checkbox for large documents where parsing on input is undesirable.
- Keyboard-first operation —
Ctrl+Enter/Cmd+Entertriggers a parse from inside the textarea. - Heuristic quality warnings — warns when Google Play looks lazily loaded (≤ 15 unique IDs) and when no store signature is detected at all.
- 14-language UI — English (default), Deutsch, Français, Español, Português, 日本語, 中文, Русский, Українська, Қазақша, Nederlands, Polski, Čeština, Svenska — with lazy
fetchof locale bundles, in-memory caching, browser-language auto-detection, and a three-tier fallback chain. All translations live in the dedicatedlocales/folder. - Theming — light/dark tokens driven by
data-theme, seeded fromprefers-color-scheme, overridable, and persisted. - Accessibility baseline — real
<label>elements,role="status"+aria-live="polite"regions, localizedaria-labels, visible focus rings, and a<noscript>guard. - Zero-dependency architecture — plain ES modules, no bundler, no framework, no
package.json, nonode_modules; the test runner is Node's built-innode:test. - Privacy by construction — no telemetry, no analytics, no
XMLHttpRequest/fetchto any third party; the only network request is the same-origin locale JSON. - Built-in sample documents — synthetic Google Play and App Store HTML fixtures loadable from the UI, so the deduplication path is visible on first run.
- Legacy URL compatibility —
bundle-crawler.htmlperforms a<meta http-equiv="refresh">+location.replace()redirect toindex.html. - DOM-free extraction core —
assets/js/parser.jsandassets/js/utils.jshave no browser globals and are directly importable in Node.js, workers, or test harnesses. - Fully static deploy artifact — the clone is the deployable; any static host (Vercel, Netlify, GitHub Pages, S3, nginx) serves it as-is.
| Layer | Technology | Version / Constraint |
|---|---|---|
| Markup | HTML5 | index.html, semantic landmarks (header / main / footer / section) |
| Styling | Hand-written CSS with custom-property design tokens | 3 files, no preprocessor, no utility framework |
| Application logic | Vanilla JavaScript, native ES Modules (type="module") |
Evergreen browsers |
| i18n | JSON locale bundles loaded via fetch |
locales/*.json — 14 languages, see locales/README.md and locales/manifest.json |
| Persistence | localStorage (guarded in try/catch) |
2 keys, see Persisted State |
| Test runner | Node.js built-in node:test + node:assert/strict |
Node.js ≥ 18 (20 LTS recommended; coverage flag stable in 22) |
| Build system | None | No transpile, no minify, no hashing |
| Package manager | None | No package.json, no lockfile |
| Hosting | Any static file server / CDN | Vercel, Netlify, GitHub Pages, S3, nginx |
Important
There is deliberately no dependency graph to install. npm install is not part of the workflow — running it will create an empty, meaningless lockfile. The only executable dependency is the Node.js binary you already use to serve files and run tests.
Visual file tree (49 files, ~432 KB including docs)
bundle-id-extractor/
├── index.html # Single entry point; all UI markup and ARIA wiring
├── bundle-crawler.html # Legacy alias → meta refresh + location.replace() to index.html
├── README.md # This document
├── API_REFERENCE.md # Public HTTP surface (static resources only)
├── CONTRIBUTING.md # Contribution workflow, DCO, coding standards
├── CODE_OF_CONDUCT.md # Contributor Covenant
├── SECURITY.md # Vulnerability reporting & disclosure policy
├── Mermaid.md # Standalone system-architecture diagrams
├── LICENSE # Apache License 2.0
├── assets/
│ ├── css/
│ │ ├── tokens.css # Design tokens: :root light palette + [data-theme="dark"]
│ │ ├── base.css # Reset, layout shells, typography, focus styles
│ │ └── components.css # Cards, buttons, inputs, listbox, toast, dropzone
│ └── js/
│ ├── app.js # Composition root: event binding, parse/detect/clear orchestration
│ ├── parser.js # Pure extraction layer — regexes only, zero DOM access
│ ├── i18n.js # Locale loading, t() interpolation, applyI18n(), language persistence
│ ├── ui.js # Rendering, result state, filter/sort projection, theme, toasts
│ ├── utils.js # $, uniqPreserveOrder, debounce, filterIds, sortIds, formatExport, clipboard, download
│ └── samples.js # Static demo HTML for the two "sample" buttons
├── locales/ # Dedicated i18n folder — one JSON per language
│ ├── manifest.json # Registry of supported languages & metadata
│ ├── README.md # How to add a new language (flat key contract)
│ ├── en.json # English — fallback & source of truth (82 keys)
│ ├── de.json · fr.json · es.json · pt.json · ja.json · zh-CN.json
│ ├── ru.json · uk.json · kk.json · nl.json · pl.json · cs.json · sv.json
├── docs/
│ └── TECHNICAL-SPECIFICATION.md # Full technical spec (module map, data flow, invariants)
├── README_docs/ # 13 translated README mirrors (all except English)
└── tests/
└── parser.test.mjs # 10 node:test cases — extraction, dedupe, detection, utils
Expanded module responsibilities (per-file contract)
assets/js/parser.js — the only module with extraction logic. Exports extractGooglePlayBundleIds(html), extractAppStoreAppIds(html), detectSources(html), and the parseAll(html) aggregator. It imports exactly one helper (uniqPreserveOrder) and touches no browser globals, which is why it is directly unit-testable under Node.
assets/js/utils.js — stateless helpers. $ is a scoped getElementById shortcut; debounce(fn, wait) returns a closure that resets its timer per call and exposes a .cancel() method; filterIds and sortIds are pure and return copies ([...ids]) so rendering never mutates the stored parse result; formatExport owns the three serialization formats; copyText and downloadText are the only effectful functions and both return booleans.
assets/js/ui.js — owns the mutable state object ({ gp, as }, each { allCount, uniq }, plus a hasParsed flag) which is the single source of truth for both result cards. Every render path derives its visible list from state through filterIds → sortIds, so filter and sort never destroy data. Also owns theme initialization/toggling and the transient toast timer (2200 ms).
assets/js/i18n.js — holds currentLang, dict, fallbackDict, a BUILTIN_EN literal dictionary, and a Map cache keyed by language code. t(key, vars) resolves via dict[key] → fallbackDict[key] → BUILTIN_EN[key] → key, then performs replaceAll('{name}', value) interpolation. applyI18n() walks four attribute families: data-i18n (textContent), data-i18n-placeholder, data-i18n-aria-label, and data-i18n-title. Language tags are normalized by normalizeLang() (handles en-US, zh_CN, case differences), resolved by resolveLang(), and detected from navigator.languages on first boot when no stored preference exists.
assets/js/app.js — the composition root and the only module that wires DOM events. Defines MAX_FILE_BYTES (10 MB) and ALLOWED_EXT, plus parse(), detect(), clearAll(), bindExport(), pasteFromClipboard(), loadFile(), loadSample(), bindDragAndDrop(), and init(). The debounced auto-parse fires after 350 ms of input idle.
assets/js/samples.js — two exported template literals (SAMPLE_GP, SAMPLE_AS) that deliberately include a duplicate link and an HTML-escaped & so the deduplication path is visible on first run.
- Pure extraction core, imperative shell.
parser.jsis intentionally free of DOM references. This is the classic functional core / imperative shell split: business logic is deterministic and unit-testable in milliseconds under Node, while all browser coupling lives inapp.jsandui.js. - Regex over a parser library. Store pages ship anywhere from a few hundred kilobytes to several megabytes of markup. Loading a full HTML parser (or shipping a WASM DOM) to locate
hreftargets would dominate bundle weight and CPU. Anchored regular expressions with a[a-zA-Z0-9._]+character class cover the observed URL grammar at a fraction of the cost and stay dependency-free. - Two counters instead of one. Each extractor returns
{ allCount, uniq }.allCountcounts every regex hit;uniqis the deduplicated list. Because multiple patterns can legitimately match the same URL (anitms-apps://apps.apple.com/…link matches theitms-apps://pattern and — depending on shape — theapps.apple.compattern),allCountis deliberately not equal touniq.length— and the UI surfaces both numbers rather than papering over the discrepancy. - Non-destructive view projection. Filtering and sorting are computed at render time from immutable state. There is no "apply filter" mutation, so clearing the filter box instantly restores the full list and exports always reflect exactly what is on screen.
- Progressive enhancement of the clipboard.
navigator.clipboardrequires a secure context and an active user gesture, and can be denied. Rather than failing silently,copyText()falls back to a hidden, opacity-zero<textarea>plusdocument.execCommand('copy'), reports a boolean, and the caller converts that boolean into a localized status message. - Storage that never breaks the app. Every
localStorageread and write is wrapped intry/catch. In private-browsing or storage-partitioned contexts, language and theme simply stop persisting — no exception escapes into the render path. - i18n as data, not markup. The document is authored once with English literals and
data-i18n*attributes, and aBUILTIN_ENliteral lives insidei18n.jsas the last-resort tier.applyI18n()rehydrates the DOM in place, which keeps the HTML meaningful before any JS runs and makes adding a locale a data-only change. - No framework, no build. Shipping source as the artifact eliminates the toolchain: there is nothing to compile, nothing to audit in
node_modules, and the diff a reviewer sees is byte-for-byte what the browser executes.
flowchart TD
A["Input source<br/>paste · clipboard · file · drag-and-drop"] --> B{"Trimmed<br/>empty?"}
B -- yes --> B1["Status: status.empty<br/>clear both result cards"]
B -- no --> C["parseAll(html)"]
C --> D["detectSources(html)<br/>hasGP / hasAS"]
C --> E["extractGooglePlayBundleIds<br/>/store/apps/details?…id=([a-zA-Z0-9._]+)"]
C --> F["extractAppStoreAppIds<br/>re1: /app/…/id(\d{6,})<br/>re2: (apps|itunes).apple.com…id(\d{6,})<br/>re3: itms-apps://…id(\d{6,})"]
E --> G["uniqPreserveOrder<br/>→ { allCount, uniq }"]
F --> H["uniqPreserveOrder<br/>→ { allCount, uniq }"]
G --> I["ui.state.gp"]
H --> J["ui.state.as"]
I --> K["applyView('gp')<br/>filterIds → sortIds"]
J --> L["applyView('as')<br/>filterIds → sortIds"]
K --> M["Render <pre> listbox<br/>count pill · meta line"]
L --> M
D --> N{"No source<br/>detected?"}
N -- yes --> N1["Status: status.noSources (warn)"]
N -- no --> N2["Status: status.detected (ok)"]
M --> O["Export: txt · csv · json<br/>or copy visible list"]
Full dependency surface (Mermaid)
graph LR
APP["app.js<br/><i>composition root</i>"] --> PAR["parser.js"]
APP --> UTIL["utils.js"]
APP --> I18N["i18n.js"]
APP --> UI["ui.js"]
APP --> SMP["samples.js"]
UI --> UTIL
UI --> I18N
PAR --> UTIL
I18N -. "fetch()" .-> LOC[("locales/*.json")]
UI -. "localStorage" .-> LS[("bundle-crawler:theme")]
I18N -. "localStorage" .-> LS2[("bundle-crawler:lang")]
TEST["tests/parser.test.mjs"] --> PAR
TEST --> UTIL
Tip
The arrows above are the complete dependency surface. If you need to port the extraction engine into a CLI, a cron job, or a worker, parser.js + utils.js are the only two files you must vendor — everything else is presentation.
| Requirement | Minimum | Notes |
|---|---|---|
| Web browser | Any evergreen build (Chrome/Edge 89+, Firefox 89+, Safari 15+) | ES modules, fetch, URL.createObjectURL, CSS custom properties |
| Node.js | ≥ 18 (20 LTS recommended; 22 LTS for the coverage flag) | Required only to run the test suite and optionally to serve files |
| Python 3 | 3.7+ | Convenience option for http.server; not required if Node is present |
| Disk | ~432 KB | The entire repository, including docs and localized READMEs |
| Network | None after load | Locale JSON is same-origin; no third-party requests |
Warning
Opening index.html directly via file:// will not work. ES module imports are blocked by CORS on the file: scheme, fetch('./locales/en.json') fails, and navigator.clipboard is unavailable outside a secure context. Always serve the directory over http://localhost (localhost is treated as a secure context).
# 1. Clone the repository
git clone https://github.com/adops-tool/bundle-id-extractor.git
cd bundle-id-extractor
# 2. Verify the toolchain (tests only — nothing to install)
node --version # expect v18.x or newer
# 3. Serve the folder as a static site (pick one)
python3 -m http.server 8000
# — or —
npx serve . -l 8000
# — or —
npx http-server . -p 8000
# 4. Open the app in your browser
# http://localhost:8000There is no npm install, no pip install, and no compose file. The clone is the deployment artifact.
Troubleshooting & alternative installation methods
| Symptom | Cause | Fix |
|---|---|---|
Blank page, console shows Failed to load module script |
Opened over file://, or the server returns the wrong MIME type for .js |
Serve over HTTP; ensure .js → text/javascript |
Locale en failed: 404 and the UI shows raw keys |
locales/ was not deployed, or the app is served from a sub-path where ./locales/ resolves incorrectly |
Keep locales/ as a sibling of index.html; the fetch path is relative (./locales/{lang}.json) |
TypeError: Cannot read properties of null in the console |
An element ID referenced by app.js is missing — typically a hand-edited index.html |
Restore the IDs listed in Runtime Constants and the DOM contract below; $() returns null for missing nodes |
| "Copy" does nothing / shows no toast | Clipboard API denied (non-secure origin, iframe without clipboard-write, or no user gesture) |
Use https:// or localhost; deploy with the clipboard-read/clipboard-write permissions policy; the legacy fallback then takes over |
| Drag-and-drop silently ignored | The drop target is not the window, or the browser navigated to the dropped file | Drop anywhere on the window; dropping a file navigates the browser away only if the drop handler didn't preventDefault() — the app calls it on window |
| Language choice not remembered | localStorage disabled (private mode, blocked cookies, storage partitioning) |
Expected degradation — language resets to English on reload |
| "File exceeds the 10 MB limit." | File exceeds MAX_FILE_BYTES |
Split the HTML, or parse a saved view-source of just the relevant section |
| "Only .html, .htm, or .txt files are supported." | File extension not in ALLOWED_EXT |
Rename to .html/.htm/.txt, or paste the markup directly |
Tests fail with node:test not found |
Node.js < 18 | Upgrade to Node 20 LTS |
Because there is no build step, "building" means producing a reproducible static archive:
# Reproducible deployable archive (excludes VCS metadata)
git archive --format=zip --prefix=bundle-id-extractor/ HEAD -o bundle-id-extractor.zip
# Or a plain recursive copy, minus git internals
rsync -av --exclude='.git' ./ ./dist/fetch('./locales/en.json') is the only network call. To run from an air-gapped disk or an embedded file:// shell, inline the English locale into the page and remove that fetch — see Custom Locales for the exact patch point in i18n.js (loadLocale, fetchDict, and the BUILTIN_EN fallback literal, which already guarantees the UI never renders raw keys).
# Fork, then clone your fork
git clone https://github.com/<you>/bundle-id-extractor.git
cd bundle-id-extractor
git remote add upstream https://github.com/adops-tool/bundle-id-extractor.git
# Serve with live reload (any static server with watch mode works)
npx serve . -l 8000 --no-clipboard # or: python3 -m http.server 8000
# Run the test suite in watch mode while editing parser.js
node --test --watch tests/parser.test.mjsThe suite covers the extraction core and the pure view helpers — by design. There is no browser test harness, no DOM emulation, and no assertion on CSS or markup.
# Run the full suite (Node.js ≥ 18)
node --test
# Explicit path + verbose reporter
node --test tests/parser.test.mjs
node --test --test-reporter=spec
# Filter by test name
node --test --test-name-pattern="dedupes"
# Watch mode (Node.js ≥ 22)
node --test --watch tests/parser.test.mjsExpected output (--test-reporter=spec, Node 22):
✔ google play: extracts package names and dedupes in order
✔ google play: handles escaped ampersands
✔ google play: handles query params before id
✔ google play: empty input gives empty result
✔ app store: extracts numeric ids from web urls
✔ app store: extracts ids from itms-apps links
✔ app store: ignores ids shorter than 6 digits
✔ detectSources: recognizes google play and app store
✔ parseAll: combines both extractors
✔ utils: filter, sort, and export formats
ℹ tests 10
ℹ pass 10
ℹ fail 0
| Test | Asserts |
|---|---|
google play: extracts package names and dedupes in order |
3 raw matches → 2 unique IDs; first-seen ordering preserved |
google play: handles escaped ampersands |
&hl=en does not corrupt the captured package name |
google play: handles query params before id |
?hl=en&id=com.example.two&gl=UA captures com.example.two (parameters before id= supported) |
google play: empty input gives empty result |
'' and non-matching markup both yield { allCount: 0, uniq: [] } |
app store: extracts numeric ids from web urls |
allCount === 6 documents intentional multi-pattern double-counting; uniq holds 2 IDs |
app store: extracts ids from itms-apps links |
id555666777 is captured from the itms-apps:// scheme |
app store: ignores ids shorter than 6 digits |
id12345 is rejected by the \d{6,} quantifier |
detectSources: recognizes google play and app store |
Correct hasGP/hasAS truth table, including the neither/nor case |
parseAll: combines both extractors |
Aggregate result shape and simultaneous detection of both stores |
utils: filter, sort, and export formats |
Case-insensitive filterIds, sortIds for az/za/found, and exact .txt/.csv/.json serialization |
# Node.js ≥ 22 — built-in coverage reporter (no c8 or nyc required)
node --test --experimental-test-coverageRepresentative report:
# file | line % | branch % | funcs % | uncovered lines
# parser.js | 100.00 | 100.00 | 100.00 |
# utils.js | 41.35 | 83.33 | 66.67 | 2-3 18-25 52-82 85-104
# all files | 75.20 | 91.11 | 85.19 |
parser.js — the extraction contract — is at 100 % line/branch/function coverage. The uncovered regions in utils.js are the DOM-coupled effectful helpers (copyText, downloadText, $), which cannot run under Node without a DOM.
Tip
Linting. The project ships no linter configuration by design (no ESLint, Prettier, or JSHint config in-tree). If you want to enforce style locally without adding repo files, run an ephemeral check: npx --yes eslint@9 --no-config-lookup --rule '{"no-unused-vars":"error","no-undef":"error"}' assets/js. Treat any new config file as a separate, deliberate contribution — the zero-toolchain guarantee is a stated design constraint.
Note
UI, i18n, and clipboard behavior are not covered by automated tests. Verify those paths manually against the checklist in Edge Cases & Known Limitations, or extend the suite by importing ui.js-free helpers (filterIds, sortIds, formatExport) directly into a new node:test file.
The artifact is a directory of static files. There is no build command, no environment variable required at runtime, and no server-side component.
# Nothing to compile. Optionally produce a clean artifact:
rsync -av --exclude='.git' --exclude='tests' ./ ./dist/
# …or a tarball for upload to object storage / a CDN
tar -czf bundle-id-extractor.tar.gz --exclude='.git' --exclude='tests' .# Vercel — zero-config, framework preset: "Other"
npx vercel --prod
# Netlify
npx netlify deploy --prod --dir .
# GitHub Pages — publish the repository root from the default branch
# Settings → Pages → Source: Deploy from a branch → / (root)Important
Vercel and Netlify auto-detect this as a static site. If a dashboard asks for a framework preset, choose Other / None and leave the build command empty. Setting a build command such as npm run build will fail because no package.json exists. When the site is hosted at the domain root, no rewrite rules are needed — bundle-crawler.html and the relative ./assets/ paths resolve as-is.
# .github/workflows/ci.yml
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Unit tests
run: node --test
- name: Extraction-core coverage (informational)
run: node --test --experimental-test-coverageDeploy on push to main by chaining a static publish step (vercel deploy --prod, netlify deploy --prod --dir ., or a actions/deploy-pages job) after the test job. Because the artifact is the repository itself, the deploy step needs no build output directory — point the host at the repository root (or the dist/ produced above).
Container deployment (Docker / Docker Compose), cache policy, and routing notes
FROM nginx:1.27-alpine
COPY index.html bundle-crawler.html /usr/share/nginx/html/
COPY assets /usr/share/nginx/html/assets
COPY locales /usr/share/nginx/html/locales
COPY LICENSE /usr/share/nginx/html/LICENSEdocker build -t bundle-id-extractor .
docker run --rm -p 8080:80 bundle-id-extractor
# → http://localhost:8080services:
web:
image: nginx:1.27-alpine
ports:
- "8080:80"
volumes:
- ./index.html:/usr/share/nginx/html/index.html:ro
- ./bundle-crawler.html:/usr/share/nginx/html/bundle-crawler.html:ro
- ./assets:/usr/share/nginx/html/assets:ro
- ./locales:/usr/share/nginx/html/locales:ro
restart: unless-stopped| Path | Recommended Cache-Control |
Rationale |
|---|---|---|
index.html, bundle-crawler.html |
no-cache |
Entry points must always revalidate |
assets/js/*.js, assets/css/*.css |
public, max-age=3600 (or content-hashed filenames + immutable) |
Filenames carry no hash, so keep the TTL conservative |
locales/*.json |
public, max-age=86400 |
Fetched with cache: 'no-cache', so revalidation is cheap |
LICENSE |
public, max-age=604800 |
Static legal text |
- No SPA fallback is required. The app has exactly one route (
/). Do not add a catch-all rewrite toindex.htmlthat would mask genuine 404s forlocales/*.json. - Sub-path hosting (e.g.
https://example.com/tools/parser/) works without changes because every asset and locale reference is relative (./assets/…,./locales/…). file://is unsupported in production. If you need an offline desktop distribution, wrap the directory in Electron/Tauri and serve via a custom protocol, or inline the locale as described in Troubleshooting.
Caution
If you deploy behind a CDN or reverse proxy that strips query strings, the app still works — parsing happens on text you paste, not on request URLs. Do not, however, place the tool behind a WAF rule that blocks large POST bodies if you later add a server-side variant: the 10 MB client cap reflects real-world page sizes.
- Open the app at
http://localhost:8000. - In the browser, open the target store page, scroll to the end so lazily loaded cards render, then copy the page's HTML (
Ctrl+U→ select all → copy, or DevTools → Elements → right-click<html>→ Copy outerHTML). - Paste into HTML.
Auto(checked by default) re-parses 350 ms after you stop typing, or press Extract /Ctrl+Enter. - Read the status line — it names the detected store(s), warns about lazy-loaded Google Play grids, or warns that the HTML does not look like a store page.
- Refine with the per-card Filter box and Sort dropdown.
- Copy the visible list or Save it in
.txt,.csv, or.json(theFormatselector governs the download).
Note
The two sample buttons (GP and iOS) load synthetic HTML that includes a duplicate link and an escaped &, so you can observe deduplication and count semantics without touching a real store page.
parser.js has no DOM dependencies — import it directly in Node.js, a bundler, a worker, or an extension.
// extract.mjs — run with: node extract.mjs page.html
import { readFile, writeFile } from 'node:fs/promises';
import {
extractGooglePlayBundleIds,
extractAppStoreAppIds,
detectSources,
parseAll,
} from './assets/js/parser.js';
const html = await readFile(process.argv[2], 'utf8');
// 1. Aggregate parse — preferred entry point
const { gp, as, sources } = parseAll(html);
console.log('Detected:', { googlePlay: sources.hasGP, appStore: sources.hasAS });
console.log(`Google Play: ${gp.uniq.length} unique / ${gp.allCount} raw matches`);
console.log(`App Store: ${as.uniq.length} unique / ${as.allCount} raw matches`);
// 2. Persist newline-delimited output
await writeFile('bundle-ids.txt', gp.uniq.join('\n'));
// 3. Individual extractors when you only care about one store
const appStoreOnly = extractAppStoreAppIds(html).uniq; // e.g. ['123456789']
const gpOnly = extractGooglePlayBundleIds(html).uniq; // e.g. ['com.example.alpha']
// 4. Cheap pre-flight: is this page even worth parsing?
if (!detectSources(html).hasGP && !detectSources(html).hasAS) {
console.warn('No store signatures found — probably the wrong page.');
}Function reference:
| Export | Signature | Returns |
|---|---|---|
extractGooglePlayBundleIds |
(html: string) |
{ allCount: number, uniq: string[] } — package names. Regex: /\/store\/apps\/details\?(?:[^"'\s<>]*&(?:amp;)?)?id=([a-zA-Z0-9._]+)/gi |
extractAppStoreAppIds |
(html: string) |
{ allCount: number, uniq: string[] } — numeric IDs as strings. Three patterns, all requiring \d{6,} |
detectSources |
(html: string) |
{ hasGP: boolean, hasAS: boolean } |
parseAll |
(html: string) |
{ gp: { allCount, uniq }, as: { allCount, uniq }, sources: { hasGP, hasAS } } |
uniqPreserveOrder |
(arr: T[]) => T[] |
First-seen-order deduplication via Set |
filterIds |
(ids: string[], query: string) => string[] |
Case-insensitive substring filter; returns a copy |
sortIds |
(ids: string[], mode: 'found' | 'az' | 'za') => string[] |
Code-unit sort on a copy; 'found' returns the copy untouched |
formatExport |
(ids: string[], format: 'txt' | 'csv' | 'json') => string |
txt: \n-delimited; csv: id header + quoted \r\n rows; json: 2-space indented array |
debounce |
(fn: Function, wait: number) => ((...args) => void) & { cancel(): void } |
Trailing-edge debounce with cancellation |
Batch-process many saved pages, then emit a single deduplicated inventory
import { readFile, readdir, writeFile } from 'node:fs/promises';
import { parseAll } from './assets/js/parser.js';
import { uniqPreserveOrder } from './assets/js/utils.js';
const files = (await readdir('./pages')).filter((f) => f.endsWith('.html'));
const gp = [];
const as = [];
const skipped = [];
for (const file of files) {
const html = await readFile(`./pages/${file}`, 'utf8');
const parsed = parseAll(html);
if (!parsed.sources.hasGP && !parsed.sources.hasAS) {
skipped.push(file); // e.g. a login wall or an empty SPA shell
continue;
}
gp.push(...parsed.gp.uniq);
as.push(...parsed.as.uniq);
}
// Merge across pages while preserving first-seen order
await writeFile('inventory.json', JSON.stringify({
googlePlay: uniqPreserveOrder(gp),
appStore: uniqPreserveOrder(as),
skipped,
}, null, 2));Use the filter/sort/export helpers to build a custom reporter
import { filterIds, sortIds, formatExport } from './assets/js/utils.js';
const ids = ['com.zeta.app', 'com.alpha.app', 'com.beta.app'];
const filtered = filterIds(ids, 'alpha'); // ['com.alpha.app']
const sorted = sortIds(ids, 'az'); // code-unit A → Z (not locale-aware)
const csv = formatExport(sorted, 'csv');
// id\r\n"com.alpha.app"\r\n"com.beta.app"\r\n"com.zeta.app"\r\n
// Supported formats: 'txt' (newline-delimited),
// 'csv' (id header, double-quoted values, escaped quotes, CRLF rows),
// 'json' (2-space indented array)
console.log(formatExport(ids, 'json'));Notes: filterIds lowercases both sides of the comparison and returns a copy; sortIds compares code units directly (a < b), so 'found' returns an untouched copy; neither helper mutates the input array.
Drive the UI from the console (theme, language, export format)
// Theme — writes bundle-crawler:theme and swaps the ☾/☀ glyph
document.getElementById('themeToggle').click();
// Language — the <select> change handler reloads the locale and re-renders
const lang = document.getElementById('langSelect');
lang.value = 'uk';
lang.dispatchEvent(new Event('change'));
// Export format switch (consumed at download time, per card)
document.getElementById('exportFormat').value = 'csv';
document.getElementById('gpDownload').click(); // → google_play_bundle_ids.csv
// Force a parse without waiting for the 350 ms debounce
document.getElementById('btnParse').click();Embed the parser in a browser extension or worker
Because parser.js only imports uniqPreserveOrder, it can run inside a service worker, a chrome.scripting content script (module world), or a Web Worker:
// worker.js
import { parseAll } from './assets/js/parser.js';
self.onmessage = ({ data: html }) => {
const { gp, as } = parseAll(html);
self.postMessage({ gp: gp.uniq, as: as.uniq });
};Caveat: the module's regexes expect markup, so feed the worker outerHTML from the page, not document.body.innerText. For a Manifest V3 extension, declare "type": "module" on the service worker and bundle the two files together.
Add a new language in three edits (all translations live in the dedicated `locales/` folder)
-
Copy the English bundle and translate only the values — keys must remain byte-identical:
cp locales/en.json locales/it.json
-
Register the language code in
assets/js/i18n.js(SUPPORTEDarray and theLANGUAGESmetadata map) and inlocales/manifest.json:// before export const SUPPORTED = ['cs', 'de', 'en', 'es', 'fr', 'ja', 'kk', 'nl', 'pl', 'pt', 'ru', 'sv', 'uk', 'zh-CN']; // after — add Italian, e.g. export const SUPPORTED = ['cs', 'de', 'en', 'es', 'fr', 'it', 'ja', 'kk', 'nl', 'pl', 'pt', 'ru', 'sv', 'uk', 'zh-CN'];
-
Add the option to the selector in
index.html:<option value="it">Italiano</option>
Resolution order at runtime is dict[key] → fallbackDict[key] (en) → BUILTIN_EN[key] → key, so a missing translation degrades to English, then to the built-in literal, and finally to the raw key name — never to a blank element. The choice is persisted under bundle-crawler:lang; an unsupported stored value is discarded on boot by initI18n().
[!TIP] Keep placeholders (
{count},{sources},{total},{all},{uniq},{shown},{query},{file},{name},{source}) intact in translations.t()performs a plainreplaceAll, so a renamed or dropped placeholder renders literally in the UI.
Behavioral contract: what the extractors intentionally do and do not capture
| Case | Behavior | Why |
|---|---|---|
Escaped ampersands (?id=com.a.b&hl=en) |
Captured correctly | The capture group [a-zA-Z0-9._]+ stops at &; the nbsp;-style suffix never enters the group |
Query parameters before id= (?hl=en&id=com.a.b) |
Captured | The Google Play regex tolerates [^"'\s<>]*&(amp;)? before id= |
Root-relative links (/store/apps/details?id=…) |
Captured | The Google Play regex is anchored on the path, not the host |
| Duplicate IDs across a page | Collapsed by uniqPreserveOrder, first position wins |
Stable ordering makes diffing exports meaningful |
App Store numeric IDs < 6 digits |
Ignored (\d{6,}) |
Guards against unrelated short integers in inline JSON |
| Same App Store URL matching two patterns | allCount counts both; uniq counts one |
Multiple patterns are intentional; the counter exposes, rather than hides, the overlap |
Generic "id": 123456789 inside embedded JSON |
Not captured | Deliberately conservative — embedded JSON contains many unrelated IDs (ads, analytics, reviews) |
iOS bundle ID (com.example.app) from public store HTML |
Not available | Public App Store markup exposes only the numeric App ID. Take the bundle ID from CI, the repository, or app config |
| Google Play with ≤ 15 unique IDs | Parsed, plus a status.lowGP warning |
Store grids load lazily; the warning prompts a scroll-to-bottom and re-copy |
| HTML that is neither store | Both lists empty, status.noSources warning |
Detection is advisory; extraction still runs |
| Input > 10 MB via file input / drag-drop | Rejected with status.fileTooLarge |
Avoids main-thread stalls from catastrophic-backtracking-prone input |
| Pasting > 10 MB directly | Accepted (no cap on paste) | The limit applies to the file path only; disable Auto for very large pastes |
| Minified HTML with no whitespace | Fully supported | Patterns rely on URL shape, not pretty-printing |
Multi-line href attributes |
Supported | No ^/$ anchors or s-flag assumptions in the extractors; the character classes exclude \n via \s |
localStorage unavailable |
Silent degradation | Every access is wrapped in try/catch |
| Clipboard permission denied | Falls back to execCommand, then reports failure |
copyText() returns a boolean; the caller localizes the outcome |
Browser noscript |
Static notice: "JavaScript is required." | The app is JS-only by definition |
Manual QA checklist (covers the untested presentation layer): load both samples → confirm the counts; type in a filter → meta line switches to results.metaFiltered; clear it → meta returns to raw/unique counts; switch to Russian and Ukrainian → no raw keys remain; reload → language and theme persist; toggle dark mode → data-theme="dark" on <html>; download in each of the three formats → filenames are google_play_bundle_ids.<ext> / app_store_app_ids.<ext>.
The app exposes no compile-time configuration file. Behavior is controlled by DOM element state, a handful of constants in source, and two localStorage keys.
| Constant | Location | Default | Effect |
|---|---|---|---|
MAX_FILE_BYTES |
assets/js/app.js |
10 * 1024 * 1024 (10 MB) |
Rejects larger files on upload/drop with status.fileTooLarge |
ALLOWED_EXT |
assets/js/app.js |
{'html', 'htm', 'txt'} |
Rejects other extensions with status.fileBadType |
| Debounce interval | assets/js/app.js (debounce(…, 350)) |
350 ms |
Idle delay before the auto-parse fires |
| Low-result threshold | assets/js/app.js (gp.uniq.length <= 15) |
15 |
Triggers the status.lowGP lazy-load warning |
SUPPORTED |
assets/js/i18n.js |
['cs','de','en','es','fr','ja','kk','nl','pl','pt','ru','sv','uk','zh-CN'] (14) |
Allow-list of locale codes; anything else falls back to en via resolveLang()/normalizeLang() |
FALLBACK |
assets/js/i18n.js |
'en' |
Secondary resolution tier for missing keys |
BUILTIN_EN |
assets/js/i18n.js |
Literal English dictionary in source | Last-resort tier when both locale fetches fail — UI never renders raw keys |
| Toast duration | assets/js/ui.js (showToast) |
2200 ms |
Auto-hide delay for the toast |
--radius, --accent, … |
assets/css/tokens.css |
see file | Design tokens; overriding :root is the supported theming hook |
Exhaustive DOM contract — element IDs required by app.js/ui.js
$() is a bare document.getElementById, so removing any of these IDs produces a null dereference at bind time rather than a graceful degradation.
| ID | Owned by | Purpose |
|---|---|---|
htmlPaste |
app.js / ui.js |
The HTML <textarea> — primary input and charCount source |
dropzone, dropOverlay |
app.js |
Drag-and-drop target and the visual overlay |
fileInput |
app.js |
Hidden <input type="file" accept=".html,.htm,.txt,…"> |
btnParse, btnDetect, btnClear, btnPaste, btnUpload, btnNotes |
app.js |
Toolbar actions (Extract / Detect / Clear / Paste / File / Notes) |
btnSampleGP, btnSampleAS |
app.js |
Load SAMPLE_GP / SAMPLE_AS |
autoParse |
app.js |
Checkbox gating the debounced re-parse |
status, statusDot |
ui.js |
Status message region (role="status", aria-live="polite") and its colored dot |
charCount |
ui.js |
Live {count} chars indicator |
langSelect |
app.js / i18n.js |
Language selector |
themeToggle, themeIcon |
ui.js |
Theme button and ☾/☀ glyph |
notesDrawer |
ui.js |
Collapsible "Supported URL patterns / tips" drawer |
gpFilter, gpSort, gpCopy, gpDownload, gpOut, gpCount, gpMeta, gpEmpty |
ui.js / app.js |
Google Play card |
asFilter, asSort, asCopy, asDownload, asOut, asCount, asMeta, asEmpty |
ui.js / app.js |
App Store card |
exportFormat |
app.js |
txt | csv | json selector, read at download time |
toast |
ui.js |
Transient confirmation, role="status" |
| Storage key | Written by | Values | Fallback when unavailable |
|---|---|---|---|
bundle-crawler:lang |
i18n.js (setLang, initI18n) |
cs | de | en | es | fr | ja | kk | nl | pl | pt | ru | sv | uk | zh-CN |
English; choice simply not remembered; legacy values are normalized via normalizeLang() |
bundle-crawler:theme |
ui.js (toggleTheme) |
light | dark |
matchMedia('(prefers-color-scheme: dark)') |
// Inspect / reset persisted UI state
localStorage.getItem('bundle-crawler:lang'); // "en"
localStorage.getItem('bundle-crawler:theme'); // "dark"
localStorage.removeItem('bundle-crawler:lang');
localStorage.removeItem('bundle-crawler:theme');Note
There is no .env support and no startup flags. This is a static client-side app: environment variables are not read anywhere in the codebase, and nothing is injected at build time. Any deployment-specific value must be edited in source or supplied via a host-level header rewrite (see HTTP Headers for Static Hosts).
All 82 locale keys by namespace
| Namespace | Count | Keys |
|---|---|---|
page.* |
1 | page.title |
lang.* |
1 | lang.label |
theme.* |
2 | theme.toDark, theme.toLight |
actions.* |
12 | actions.parse, actions.parseTitle, actions.detect, actions.detectTitle, actions.paste, actions.pasteTitle, actions.upload, actions.uploadTitle, actions.clear, actions.clearTitle, actions.autoParse, actions.autoParseTitle |
samples.* |
5 | samples.label, samples.gp, samples.gpTitle, samples.as, samples.asTitle |
input.* |
5 | input.heading, input.placeholder, input.dropHint, input.footerHint, input.charCount ({count}) |
results.* |
18 | results.gpTitle, results.asTitle, results.copy, results.copyGpTitle, results.copyAsTitle, results.download, results.downloadGpTitle, results.downloadAsTitle, results.filterPlaceholder, results.filterGpAria, results.filterAsAria, results.metaIdle, results.meta ({all}, {uniq}), results.metaFiltered ({shown}, {total}), results.emptyIdleGp, results.emptyIdleAs, results.emptyParsed, results.emptyFiltered ({query}) |
sort.* |
4 | sort.label, sort.found, sort.az, sort.za |
export.* |
2 | export.label, export.aria |
status.* |
22 | status.ready, status.empty, status.detected ({total}, {sources}), status.noSources ({total}), status.lowGP ({total}), status.dirty, status.autoOff, status.detectEmpty, status.detectedAs ({sources}), status.detectUnknown, status.copied ({count}, {source}), status.copyFail, status.listEmpty ({source}), status.downloaded ({file}), status.pasteOk, status.pasteFail, status.fileLoaded ({name}), status.fileBadType, status.fileTooLarge, status.fileReadFail, status.sampleLoaded ({name}, {total}), status.cleared |
footer.* |
2 | footer.local, footer.notes |
notes.* |
6 | notes.patternsTitle, notes.patternsBody, notes.iosTitle, notes.iosBody, notes.tipsTitle, notes.tipsBody |
source.* |
2 | source.gp, source.as |
| Total | 82 | Mirrored byte-for-byte across all 14 locale bundles |
Full default locale schema (locales/en.json) — abbreviated sample
{
"page.title": "Bundle IDs Parser",
"lang.label": "Language",
"actions.parse": "Extract",
"input.charCount": "{count} chars",
"results.meta": "Matches: {all} · Unique: {uniq}",
"results.metaFiltered": "Showing {shown} of {total}",
"status.detected": "Extracted {total} unique IDs ({sources}).",
"status.lowGP": "Extracted {total} IDs. Google Play lazy-loads lists — scroll to bottom before copying HTML.",
"status.sampleLoaded": "Loaded {name} sample ({total} IDs).",
"sort.found": "As found",
"export.label": "Format",
"source.gp": "Google Play",
"source.as": "App Store"
}The file is flat — no nesting, dot-delimited keys, UTF-8, 2-space indent. Adding a key requires no code change: t('your.new.key') resolves it automatically, and a missing entry degrades to English, then to the built-in literal, then to the key string itself.
Recommended vercel.json / _headers / nginx snippet
{
"headers": [
{
"source": "/(index|bundle-crawler)\\.html",
"headers": [{ "key": "Cache-Control", "value": "no-cache" }]
},
{
"source": "/locales/(.*)",
"headers": [{ "key": "Cache-Control", "value": "public, max-age=86400" }]
},
{
"source": "/(.*)",
"headers": [
{ "key": "X-Content-Type-Options", "value": "nosniff" },
{ "key": "Referrer-Policy", "value": "no-referrer" },
{ "key": "Permissions-Policy", "value": "clipboard-read=(self), clipboard-write=(self)" }
]
}
]
}Netlify equivalent (_headers):
/index.html
Cache-Control: no-cache
/locales/*
Cache-Control: public, max-age=86400
/*
X-Content-Type-Options: nosniff
Referrer-Policy: no-referrer
Permissions-Policy: clipboard-read=(self), clipboard-write=(self)
nginx:
location / {
root /usr/share/nginx/html;
index index.html;
add_header X-Content-Type-Options nosniff always;
add_header Referrer-Policy no-referrer always;
location ~* \.(js|css)$ { expires 1h; }
location /locales/ { expires 1d; }
}Permissions-Policy is what keeps the Paste from clipboard button functional on hosts that tighten the default clipboard policy. If you omit it, the legacy execCommand fallback still covers copy, but reading the clipboard on paste will be blocked.
Apache License 2.0 — see LICENSE for the full text.
Permitted: commercial use, modification, distribution, patent use, and private use. Required: inclusion of the license and copyright notice, and prominent documentation of any modified files. The license includes an express patent grant and a trademark restriction. No warranty is provided; the software is distributed on an "AS IS" basis.
Caution
Do not remove or alter the LICENSE file in redistributions. If you fork and modify the extraction patterns, add a notice stating which files were changed, as required by §4(b) of the license.
If you find this tool useful, consider leaving a star on GitHub or supporting the author directly.