forked from c-fu/arah2
fix(03-04): GEO-03 probe platform allowlist — official telegram-web-app.js writes one sessionStorage bookkeeping key; app surfaces stay empty
This commit is contained in:
+11
-4
@@ -290,17 +290,24 @@ try {
|
||||
]);
|
||||
if (signal === 'timeout') throw new Error('GEO-03 probe leg: ARAHARAH-LIVE never arrived within 30000ms');
|
||||
await page.waitForTimeout(1500);
|
||||
/* Platform allowlist (device-matrix exit addendum): the OFFICIAL
|
||||
* telegram-web-app.js (added in debug round 3) writes exactly one
|
||||
* sessionStorage key — `__telegram__initParams`, the SDK's own launch
|
||||
* bookkeeping ({}, or Telegram-supplied launch params). It is not app
|
||||
* data, carries no coordinates, and the D-07 law binds OUR surfaces —
|
||||
* which remain byte-empty. Any OTHER key still fails the probe. */
|
||||
const probe = await page.evaluate(async () => ({
|
||||
local: localStorage.length,
|
||||
session: sessionStorage.length,
|
||||
foreignSessionKeys: Object.keys(sessionStorage).filter((k) => k !== '__telegram__initParams'),
|
||||
ssForeignOnly: Object.keys(sessionStorage).every((k) => k === '__telegram__initParams'),
|
||||
cookie: document.cookie,
|
||||
dbs: (await indexedDB.databases()).length,
|
||||
lsKeys: Object.keys(localStorage),
|
||||
}));
|
||||
if (probe.local !== 0 || probe.session !== 0 || probe.cookie !== "" || probe.dbs !== 0) {
|
||||
failures.push(`GEO-03 runtime probe FAILED — localStorage=${probe.local} sessionStorage=${probe.session} cookie="${probe.cookie}" indexedDB=${probe.dbs} keys=${JSON.stringify(probe.lsKeys)}`);
|
||||
if (probe.local !== 0 || !probe.ssForeignOnly || probe.cookie !== "" || probe.dbs !== 0) {
|
||||
failures.push(`GEO-03 runtime probe FAILED — localStorage=${probe.local} foreignSessionKeys=${JSON.stringify(probe.foreignSessionKeys)} cookie="${probe.cookie}" indexedDB=${probe.dbs} keys=${JSON.stringify(probe.lsKeys)}`);
|
||||
} else {
|
||||
log.push('GEO-03 runtime probe PASSED — localStorage/sessionStorage/cookies/IndexedDB all empty after boot-to-live');
|
||||
log.push('GEO-03 runtime probe PASSED — app storage surfaces empty after boot-to-live (platform allowlist: SDK-owned __telegram__initParams only)');
|
||||
}
|
||||
} catch (err) {
|
||||
failures.push(`GEO-03 runtime probe: ${err.message}`);
|
||||
|
||||
Reference in New Issue
Block a user