You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a44bf17
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
8
8
### Added
9
9
10
10
-**Edit overrides in VS Code.****Open in VS Code**, on an override's tab, its right-click menu in the Explorer or the command palette, opens its file there. Save it in VS Code, or any other editor, and the page reloads with your version, just as if you had saved in the app. A tab left open shows the new text; if it has edits you haven't saved, it keeps them and offers the saved file's version instead. **Show in folder** finds the file for any other editor.
11
+
-**Share your overrides.** The new menu on the Explorer's **Overrides** section (or the command palette) exports a workspace's overrides and rules as one file, and imports one: send it to a teammate and they see the page with your fix, or copy your changes to another workspace. An import adds only what the workspace doesn't have yet, so your own versions are kept, and tells you what it left out.
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,7 @@ Each workspace keeps its own page, tabs, overrides, rules and actions, so a fix
48
48
-**Edit what the page actually loaded.** Scripts, stylesheets and HTML appear under **Page resources** as they load, grouped by origin, iframes and workers included. Minified bundles are pretty-printed when you open them.
49
49
-**Save to serve it.** <kbd>Ctrl</kbd>/<kbd>⌘</kbd> + <kbd>S</kbd> reloads the page with your version, before the page runs anything, on every load, until you switch the override off.
50
50
-**Or edit in VS Code.****Open in VS Code** opens an override's file there: what you save is served, and the page reloads with it.
51
+
-**Share a fix.** Export a workspace's overrides and rules as one file; a teammate imports it and sees the same page.
51
52
-**Survives deploys.** A hashed bundle name such as `main.3f9a1c2b.js` can be matched as `main.*.js` in one click, and you're warned when the live file changes under your override. **Diff** (<kbd>Ctrl</kbd>/<kbd>⌘</kbd> + <kbd>Shift</kbd> + <kbd>D</kbd>) shows what you changed.
52
53
-**Handles the hard cases:** compressed responses, Subresource Integrity (static and set at runtime), the HTTP cache, service workers and worklets, stale source maps.
53
54
-**Reads the original sources.** When the site publishes source maps, expand a bundle to open the TypeScript, JSX or SCSS it was built from, and jump between a line of it and the bundle code it became (<kbd>Ctrl</kbd>/<kbd>⌘</kbd> + <kbd>Shift</kbd> + <kbd>M</kbd>).
Copy file name to clipboardExpand all lines: docs/SPEC.md
+13-2Lines changed: 13 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ A desktop app where you enter a website's URL, see every script, stylesheet and
30
30
| U11 | I can edit override files in my own editor (VS Code) and the app picks up changes | ✅ (§7, Another editor) |
31
31
| U12 | Overrides and file listing inside iframes, including cross-site (out-of-process) and nested ones | ✅ |
32
32
| U12b | Overrides and file listing for what workers load: dedicated, shared and service workers, and worklets | ✅ (except a nested worker's first script, §6.6) |
33
-
| U13 | Export/import a workspace's overrides to share them with teammates |🔜 M2|
33
+
| U13 | Export/import a workspace's overrides to share them with teammates |✅ (§5, Sharing)|
34
34
| U14 | Use my own Chrome (existing profile, extensions) instead of the embedded browser | 🔜 M3 |
35
35
| U15 | Browse original sources from source maps (read-only) and jump to the matching bundle code | ✅ (§6.8) |
36
36
| U16 | I keep a workspace per site or task (its page, tabs, unsaved edits and overrides) and switch between them from the rail, which shows each one's favicon or a colour I pick | ✅ (§5.1) |
@@ -340,6 +340,16 @@ A version 1 `session.json` (one page and its tabs) becomes the first workspace,
340
340
341
341
**Edits made elsewhere.** `OverrideFileWatcher` (`src/main/overrideFiles/`) watches `files/` (`fs.watch`, not persistent). Only content files count (`<id>.<ext>`: not a base, nor a temp file such as `writeAtomic`'s or an editor's swap file). Once the folder has been quiet for 200 ms (`EDIT_SETTLE_MS`: a save can be several writes, a checkout many files), each changed override's file is read in the store's write queue (`takeFileEdit`), after any write of the app's own, so the app's writes read back unchanged. A file that differs becomes the override's content: in memory, so the engine serves it at once, and in the index, with a new `updatedAt`. A missing file (an editor renaming its save over it) is taken once it is back; until then the override keeps serving what it had. When the platform names no file, the active workspace's overrides are all checked. The active workspace's changed overrides then go to the renderer, in one batch, with `overrides-changed` and then `overrides-edited`. Another workspace's are served as edited once it is active again.
342
342
343
+
**Sharing.****Export overrides and rules…** (the Explorer's Overrides menu, the palette) writes the active workspace's overrides and rules to one JSON file where the user picks (a native dialog, named after the page's host: `shop.test-overrides.json`); **Import overrides and rules…** adds a file's to the active workspace (`src/main/overridesFile/`):
344
+
345
+
```
346
+
{ format: 'console-editor-overrides', version: 1,
347
+
overrides: { kind, sourceUrl, match, enabled, originalHash, request?, response?, content, base? }[], // base only when it differs
348
+
rules: (CreateRuleInput & { enabled })[] } // no ids or times: the importing store sets them
349
+
```
350
+
351
+
An import reads a file of at most 200 MB with `overridesFileSchema` (`src/shared/overrides`): the format, a `version` this build reads (a newer one is refused, with a word to update), at most 500 overrides. It then checks each entry as the app's own input: an override's shapes with `exportedOverrideSchema` (a known kind, an http(s) source URL, a usable matcher, a SHA-256 or null), then what a response override matches and answers as the store does (`responseFieldsOf`); a rule with `ruleInputSchema`. An entry that fails is left out and counted. So is one the workspace already has, which keeps its own: an override answering the same requests (kind, matcher and, for a response override, method and GraphQL operation), or a rule doing the same (`sameRuleInput`). The rest are created in order, turned off when they were off (a rule made in the same millisecond as another of its workspace goes past the newest, so rules, which apply oldest first, keep the order they were made in), and `overrides-changed` and `rules-changed` follow, even when a later one fails (a full workspace refuses a rule). The renderer says what was added and left out, and reloads the page if that setting is on.
352
+
343
353
**Rules on disk.**`RuleStore` writes a change to disk before it reaches memory (and so the engine); a failed write leaves the rules as they were. Entries this build can't read (a newer version's action or request type, a hand edit) are neither listed nor applied, and are written back as they were. A `rules.json` that isn't JSON of the right shape is moved to `rules.json.broken` and the app starts with no rules; one that can't be read, or moved aside, is left alone and every change is refused, so it is never written over. Either way the window says so once it opens.
344
354
345
355
**Session restore.** The main process remembers the page URL on every main-frame navigation, for the active workspace. The renderer writes the tab list 300 ms after it changes and a tab's draft 800 ms after typing pauses (the base once per tab); a draft is deleted when its tab is saved, undone back to the saved text, or closed. Closing the window runs a handshake: main sends `flush-session`, the renderer writes whatever is pending and answers `sessionFlushed(ok)`, and only then does the window close (after 5 s, or if a write failed, it asks before closing). On start, the app loads the last URL (a URL on the command line wins), then reopens each tab: an override from the store, a tab with a draft entirely from disk (no network), any other tab by fetching the file again; drafts are applied as one undoable edit, so the tab shows as unsaved and undo reveals the saved text. Tab ids are unique across runs because they name the drafts. Session syncing starts only after restoring, so a fresh start never overwrites the session being restored. Each sync run is bound to one workspace: tab lists are written with its id, and one that arrives for a deleted workspace is ignored.
@@ -721,6 +731,7 @@ The site's `WebContentsView` can move to a window of its own (`PageWindow`), e.g
721
731
- One instance per data folder (`app.requestSingleInstanceLock`), so two processes never write the same overrides and session files. A second launch hands its URL to the running window and exits; if the first is still starting, that URL replaces the one it was about to open. On macOS, where Finder and `open` reopen the running app instead of starting a second process, the app also takes URLs from `open-url` the same way (following Electron's documentation; not yet checked on a Mac). Runs from source use a separate `… (dev)` data folder, so they never share one with an installed copy.
722
732
- IPC inputs are type-checked; rules, rule edits, matchers and actions are parsed with the Zod schemas the forms use (`src/shared/rules`, `src/shared/actions`) before storage: unknown keys are dropped, a field of the wrong shape is refused by name (`Invalid rule: match`), and a value by what is wrong with it (header names are tokens, values hold no line breaks, protected headers are refused, at most 32 header changes and 200 rules per workspace). Files are read with the same schemas. Settings are filtered to known boolean keys. Source-map calls take only an http(s) bundle URL: main derives the map URL itself.
723
733
- Opening an override in another editor takes only its id: main makes the path and VS Code's URL itself, and never hands the file to the system's handler for its type (Windows runs `.js` files). What another editor saves there is served as the app's own saves are.
734
+
- An imported file of overrides is code the page will run, as a HAR import's responses are: only what the user picks is read, every entry is checked as the app's own input before it is stored, and nothing a workspace already has is replaced.
724
735
- Original sources are only ever shown as editor text, and their names (which the page chooses) as plain labels with control characters removed.
725
736
- The page stack's detector runs in each frame's main world, where the page can change what it answers: only known ids and signals are kept, versions only when they look like one, and everything shown besides a version is the app's own text (§6.12). The React hook stand-in is a global the page can see; **Framework hooks** turns it off.
726
737
- The component inspector's adapter runs in the main world of the frame picked in, where the page could change what it answers: the answer is checked the same way (§6.13), and names, previews and keys are only ever shown as plain labels. Reading where a function is defined turns the page's Debugger domain on for a moment, with pauses skipped, and off again. Setting state runs in the page with a value the renderer wrote as JSON, parsed by main and passed as an argument, never as code.
@@ -786,7 +797,7 @@ The package manager is asked rather than electron-builder's `resources/package-t
786
797
- ✅ Workers: dedicated, shared and service workers, and worklets (§6.6).
787
798
- ✅ Edit override files in another editor: the app serves what is saved there and reloads the page, and **Open in VS Code** opens a file (§5, §7).
788
799
- ✅ Workspaces: a page, tabs and overrides per site or task (§5.1).
789
-
- Export/import a workspace's overrides as a zip or JSON, so a teammate can reproduce your fix.
800
+
-✅ Export/import a workspace's overrides and rules as one JSON file, so a teammate can reproduce your fix (§5, Sharing).
790
801
- ✅ Response header overrides (CORS, CSP, cache) and request blocking (e.g. disable an analytics script): rules (§6.3).
791
802
- Network panel ([NETWORK_PANEL.md](NETWORK_PANEL.md)): ✅ the page's requests (§6.10), response overrides for fetch/XHR with a JSON editor (§6.3, §7), answering without sending the request and patching the live response (§6.3), breakpoints and Copy as fetch (§6.11), quick edits for UI states (§7), network speed, WebSocket messages (read-only) and HAR export and import (§6.10), and a response's JSON as a tree with in-place edits (§7).
792
803
- Search across all page resources (find which bundle defines a function).
0 commit comments