Commit 1a5b158
feat(extension): stop resolving Moshpit names in the browser
Name resolution belongs at the operating system. `moshcode dns enable` sets it
up once per machine and every application resolves Moshpit names — curl, a
terminal, another browser — instead of only this one. Doing it here made the
namespace a property of the browser rather than of the machine, which is both
the wrong layer and a worse experience: a name that worked in a tab and
nowhere else.
It also cost every navigation. `webNavigation.onBeforeNavigate` was registered
with no URL filter, so every top-level navigation woke the MV3 service worker,
which re-imported background.js -> moshpit.js -> tlds.js -> tld-data.js and
rebuilt the IANA set before deciding, almost always, to do nothing. The
classification itself is O(1); the wake-up is not, and it landed on every page
load whether or not a Moshpit name was involved. With the extension loaded the
browser was slow; without it, fast.
Removed the two navigation hooks, the resolution modules and the TLD data they
consulted, the options-page settings, the reference implementation in
apps/desktop/src, the update-tlds chore that existed to regenerate the data,
and the @moshcoder/moshpit-resolve devDependency.
The `webNavigation` permission goes with them — those hooks were its only
users. That is the part worth keeping: an extension that no longer watches
every navigation cannot slow one down, and no longer asks for permission to
see them.
The Tor bypass list drops to loopback. The pit's hosts were exempted so a cold
circuit could still answer a registry lookup before navigation; with no lookup,
nothing needs to skip the proxy, and everything else goes through it.
Settings now point at `moshcode dns enable` rather than offering a mode.
Verified: no dangling imports across the extension, the linux archive builds
with no moshpit/tlds files staged, lint clean, 68 tests pass (the 101 removed
were the deleted modules' own).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent bfe9cb2 commit 1a5b158
20 files changed
Lines changed: 17 additions & 3386 deletions
File tree
- .github/workflows
- apps/desktop
- extensions/ai-sidebar
- scripts
- src
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
| 93 | + | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | 1 | | |
5 | 2 | | |
6 | 3 | | |
| |||
169 | 166 | | |
170 | 167 | | |
171 | 168 | | |
172 | | - | |
| 169 | + | |
173 | 170 | | |
174 | 171 | | |
175 | 172 | | |
176 | 173 | | |
177 | 174 | | |
178 | 175 | | |
179 | 176 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
188 | 180 | | |
189 | 181 | | |
190 | 182 | | |
| |||
198 | 190 | | |
199 | 191 | | |
200 | 192 | | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
| 193 | + | |
206 | 194 | | |
207 | 195 | | |
208 | 196 | | |
| |||
301 | 289 | | |
302 | 290 | | |
303 | 291 | | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
This file was deleted.
This file was deleted.
0 commit comments