Organize extension source and tests into folders

This commit is contained in:
2026-09-17 22:30:50 -07:00
parent f8935c656c
commit 1d6fc9e062
21 changed files with 16 additions and 15 deletions

View File

@@ -2,7 +2,7 @@
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="module" crossorigin src="/index.js"></script> <script type="module" crossorigin src="/index.js"></script>
<link rel="stylesheet" crossorigin href="/index.css"> <link rel="stylesheet" crossorigin href="/index.css">
</head> </head>

View File

@@ -2,7 +2,7 @@
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="module" crossorigin src="/index.js"></script> <script type="module" crossorigin src="/index.js"></script>
<link rel="stylesheet" crossorigin href="/index.css"> <link rel="stylesheet" crossorigin href="/index.css">
</head> </head>

Binary file not shown.

Binary file not shown.

View File

@@ -35,7 +35,7 @@ Detection requires an exact match to one of the nine registered signatures (thre
For compatibility, inØsight still reads the old five-character PLAIN headers and ten-character encrypted headers for ZWUS-3, ZWUS-6, and ZWUS-7. New encoding always writes the 11-character format. Complete modern signatures take priority within an uninterrupted zero-width run. Legacy messages separated from modern messages by visible text remain independently detectable. For compatibility, inØsight still reads the old five-character PLAIN headers and ten-character encrypted headers for ZWUS-3, ZWUS-6, and ZWUS-7. New encoding always writes the 11-character format. Complete modern signatures take priority within an uninterrupted zero-width run. Legacy messages separated from modern messages by visible text remain independently detectable.
Legacy recognition is isolated in `LEGACY_SIGNATURES` and `parseLegacySig` in `sig.js`, with explicitly labeled legacy tests. To retire it, remove that registry, reader, legacy tests, and the `legacyPlain` condition in `findSig`, then make `parseSig` use only `parseModernSig`. Future standards must not be added to the legacy registry. Legacy recognition is isolated in `LEGACY_SIGNATURES` and `parseLegacySig` in `src/sig.js`, with explicitly labeled legacy tests. To retire it, remove that registry, reader, legacy tests, and the `legacyPlain` condition in `findSig`, then make `parseSig` use only `parseModernSig`. Future standards must not be added to the legacy registry.
Incomplete or unknown extended headers do not fall back to legacy PLAIN. Exact legacy encrypted headers remain recognized, with everything after their tenth character treated as payload. Incomplete or unknown extended headers do not fall back to legacy PLAIN. Exact legacy encrypted headers remain recognized, with everything after their tenth character treated as payload.

View File

@@ -4,7 +4,7 @@
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
"test": "bun test sig.test.js content.test.js", "test": "bun test tests/sig.test.js tests/content.test.js",
"dev": "vite --mode chrome", "dev": "vite --mode chrome",
"build:web": "vite build --mode web", "build:web": "vite build --mode web",
"build:firefox": "vite build --mode firefox", "build:firefox": "vite build --mode firefox",

View File

@@ -1,4 +1,4 @@
<p align="center"><img src="icon_500.png" width="128"></p> <p align="center"><img src="src/assets/icon_500.png" width="128"></p>
<h1 align="center">inØsight</h1> <h1 align="center">inØsight</h1>
<p align="center">This sentence contains hidden text you can only read by installing inzerosight.­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p> <p align="center">This sentence contains hidden text you can only read by installing inzerosight.­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 131 KiB

View File

View File

@@ -3,7 +3,7 @@
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
font-display: swap; font-display: swap;
src: url('fonts/open-sans-v44-latin-regular.woff2') format('woff2'); src: url('assets/fonts/open-sans-v44-latin-regular.woff2') format('woff2');
} }
html, body, div, span, applet, object, iframe, html, body, div, span, applet, object, iframe,

View File

@@ -1,7 +1,7 @@
import assert from 'node:assert/strict'; import assert from 'node:assert/strict';
import { test } from 'node:test'; import { test } from 'node:test';
import zwus from 'zwus'; import zwus from 'zwus';
import { makeSig } from './sig.js'; import { makeSig } from '../src/sig.js';
test('page overlay detects headers split by WBR and decodes across the split', async () => { test('page overlay detects headers split by WBR and decodes across the split', async () => {
const buttons = [], inserted = [], fixtures = [], texts = []; const buttons = [], inserted = [], fixtures = [], texts = [];
@@ -78,7 +78,7 @@ test('page overlay detects headers split by WBR and decodes across the split', a
}; };
globalThis.requestAnimationFrame = callback => { callback(); return 1; }; globalThis.requestAnimationFrame = callback => { callback(); return 1; };
await import('./content.js'); await import('../src/content.js');
assert.equal(buttons.length, fixtures.length); assert.equal(buttons.length, fixtures.length);
fixtures.forEach(({ cipher }, i) => fixtures.forEach(({ cipher }, i) =>
assert.equal(buttons[i].textContent, cipher === 'PLAIN' ? 'Decode' : 'Decrypt')); assert.equal(buttons[i].textContent, cipher === 'PLAIN' ? 'Decode' : 'Decrypt'));

View File

@@ -1,10 +1,10 @@
import assert from 'node:assert/strict'; import assert from 'node:assert/strict';
import { test } from 'node:test'; import { test } from 'node:test';
import zwus from 'zwus'; import zwus from 'zwus';
import * as chunked from './chunked.js'; import * as chunked from '../src/chunked.js';
import * as ctr from './speck48_96ctr.js'; import * as ctr from '../src/speck48_96ctr.js';
import * as ecb from './speck32_64ecb.js'; import * as ecb from '../src/speck32_64ecb.js';
import { makeSig, parseSig, parseModernSig, parseLegacySig, getPayloadEnd } from './sig.js'; import { makeSig, parseSig, parseModernSig, parseLegacySig, getPayloadEnd } from '../src/sig.js';
// Frozen wire-format fixtures, independent of the signature registry. // Frozen wire-format fixtures, independent of the signature registry.
const HEADERS = { const HEADERS = {

View File

@@ -65,15 +65,16 @@ export default defineConfig(async ({ mode }) => {
plugins.push({ plugins.push({
name: 'copy-icon', name: 'copy-icon',
writeBundle() { writeBundle() {
if (fs.existsSync('icon_500.png')) { if (fs.existsSync('src/assets/icon_500.png')) {
fs.copyFileSync('icon_500.png', `dist/${target}/icon_500.png`); fs.copyFileSync('src/assets/icon_500.png', `dist/${target}/icon_500.png`);
} }
} }
}); });
return { return {
root: 'src',
build: { build: {
outDir: `dist/${target}`, outDir: `../dist/${target}`,
emptyOutDir: true, emptyOutDir: true,
}, },
plugins, plugins,