Skip to content

Commit 1d37be8

Browse files
authored
Merge branch 'master' into production
2 parents 6bfaf2f + 8166920 commit 1d37be8

34 files changed

Lines changed: 2837 additions & 7 deletions

File tree

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[BUG]"
5+
labels: bug
6+
assignees: ''
7+
type: Bug
8+
9+
---
10+
11+
## Summary
12+
<!-- Briefly describe the issue -->
13+
14+
## Environment
15+
16+
| Field | Value |
17+
|---------|---------|
18+
| Requestly Version | |
19+
| Browser / App | |
20+
| OS | |
21+
22+
## Steps to Reproduce
23+
24+
1.
25+
2.
26+
3.
27+
28+
## Expected Result
29+
30+
<!-- What should have happened? -->
31+
32+
## Actual Result
33+
34+
<!-- What happened instead? -->
35+
36+
## Interception Configuration
37+
38+
### Rule Details
39+
Rule Type:
40+
- [ ] Redirect Request
41+
- [ ] Modify Request Headers
42+
- [ ] Modify Response Headers
43+
- [ ] Modify Request Body
44+
- [ ] Modify API Response
45+
- [ ] Delay Request
46+
- [ ] Block Request
47+
- [ ] Insert Script
48+
- [ ] Other
49+
50+
## Logs & Evidence
51+
52+
### Console Errors
53+
```text
54+
Paste console errors here
55+
```
56+
57+
### Network Logs
58+
```text
59+
Paste request/response details here
60+
```
61+
62+
### Screenshots / Recordings
63+
<!-- Attach screenshots, videos, HAR files, or Requestly rule export -->
64+
65+
## Workaround
66+
<!-- Any temporary workaround available? -->
67+
68+
## Additional Notes
69+
<!-- Any other context that may help debugging -->
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: "[Feature Request]"
5+
labels: enhancement, type:feature
6+
assignees: ''
7+
type: Feature
8+
9+
---
10+
11+
## Summary
12+
<!-- Briefly describe the requested feature -->
13+
14+
## Problem Statement
15+
16+
<!-- What problem are you trying to solve? -->
17+
18+
## Use Case
19+
20+
<!-- Describe the real-world workflow or testing scenario -->
21+
22+
## Proposed Solution
23+
24+
<!-- Describe the desired functionality -->
25+
26+
27+
## Alternatives Considered
28+
29+
<!-- Existing workarounds or competing solutions -->
30+
31+
## Additional Context
32+
33+
<!-- Screenshots, examples, links, references, related issues -->

app/src/config/constants/compatibility.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export const FEATURE_COMPATIBLE_VERSION = {
184184
[FEATURES.COMPATIBLE_DESKTOP_APP]: {
185185
[GLOBAL_CONSTANTS.APP_MODES.DESKTOP]: {
186186
macOS: "25.5.20",
187-
Windows: "25.6.25",
187+
Windows: "26.6.8",
188188
Linux: "1.4.20",
189189
},
190190
[GLOBAL_CONSTANTS.APP_MODES.EXTENSION]: null,
@@ -193,7 +193,7 @@ export const FEATURE_COMPATIBLE_VERSION = {
193193
[FEATURES.NON_BREAKING_DESKTOP_APP]: {
194194
[GLOBAL_CONSTANTS.APP_MODES.DESKTOP]: {
195195
macOS: "25.5.20",
196-
Windows: "25.6.25",
196+
Windows: "26.6.8",
197197
Linux: "1.4.20",
198198
},
199199
[GLOBAL_CONSTANTS.APP_MODES.EXTENSION]: null,

browser-extension/common/claude.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
Shared code used by the MV3 browser extension (and previously MV2, now deprecated). Contains the storage abstraction layer, popup UI, devtools panel, custom elements (in-page widgets), and shared constants/types.
2+
3+
# Code Organization
4+
5+
## Core Modules (`src/`)
6+
7+
- **`storage.ts`** — Abstraction over `chrome.storage.local`. Provides CRUD operations (`saveRecord`, `getRecord`, `removeRecord`, `getAllRecords`) and a reactive change listener (`onRecordChange`) with filtering by change type, key, and value. All extension storage access should go through this module.
8+
- **`rulesStore.ts`** — Rule/group retrieval layer built on top of `storage.ts`. Provides `getRules`, `getGroups`, `getEnabledRules` (filters by status and group status), `onRuleOrGroupChange` (reactive listener that only fires on meaningful changes).
9+
- **`constants.ts`** — Message action constants (`EXTENSION_MESSAGES`, `CLIENT_MESSAGES`, `APP_MESSAGES`), storage keys, rule title mappings, and the `PUBLIC_NAMESPACE` (`__REQUESTLY__`).
10+
- **`types.ts`** — Core extension types: `Rule`, `Group`, `RuleType`, `ObjectType`, `Status`, `SourceOperator`, `SourceKey`, DNR-related types (`UpdateDynamicRuleOptions`).
11+
- **`config.ts`** — Runtime config (log level).
12+
- **`eventUtils.ts`** — Event tracking utility helpers.
13+
- **`utils.ts`** — General-purpose utility functions.
14+
15+
## Popup (`src/popup/`)
16+
17+
The extension popup UI — a standalone React app (Ant Design dark theme) rendered in the popup window.
18+
19+
- Entry point: `index.tsx` — Renders `<Popup>` inside `RecordsProvider` and Ant Design `ConfigProvider`.
20+
- **`components/Popup/`** — Main popup component with header and tab navigation.
21+
- **`components/PopupTabs/`** — Tab navigation (recent rules, pinned rules, executed rules, session recording).
22+
- **`components/ExecutedRules/`** — Shows rules that fired on the current tab.
23+
- **`components/RecentRecords/`**, **`PinnedRecords/`** — Rule lists with pin/unpin actions.
24+
- **`components/SessionRecording/`** — Session recording controls.
25+
- **`components/ApiClientContainer/`** — API client entry point in popup.
26+
- **`components/DesktopAppProxy/`** — Desktop app connection status and controls.
27+
- **`components/HttpsRuleOptions/`** — HTTPS rule configuration.
28+
- **`contexts/RecordsContext/`** — React context + reducer for managing records state (rules, groups, pinned items) in the popup.
29+
30+
## Devtools Panel (`src/devtools/`)
31+
32+
Chrome DevTools panel integration — adds a "Requestly" panel to Chrome DevTools.
33+
34+
- **`devtools.js`** — Panel registration via `chrome.devtools.panels.create`. Firefox gets plain text title; Chrome/others get emoji prefix.
35+
- **`index.tsx`** — Devtools panel React app entry point.
36+
- **`containers/network/`** — Network log viewer with request/response details, headers, payload tabs, and filtering toolbars.
37+
- **`containers/executions/`** — Rule execution log viewer showing which rules were applied.
38+
- **`containers/analytics-inspector/`** — Analytics event inspector for debugging third-party tracking.
39+
- **`components/`** — Shared devtools UI components (resource type filter, icon button, empty state placeholder).
40+
41+
## Custom Elements (`src/custom-elements/`)
42+
43+
Web Components (Custom Elements) injected into target pages for in-page UI:
44+
45+
- **`toast/`** — Toast notification widget.
46+
- **`test-rule-widget/`** — Widgets shown during rule testing:
47+
- `explicit-test-rule-widget/` — Shown when user explicitly tests a rule.
48+
- `implicit-test-rule-widget/` — Shown for automatic rule testing feedback.
49+
- **`session-recording-widgets/`** — Session recording UI:
50+
- `manual-mode-widget/` — Controls for manual recording.
51+
- `auto-mode-widget/` — Controls for auto recording.
52+
- `draft-session-viewer/` — Preview of recorded session.
53+
- `post-session-save-widget/` — Post-save confirmation widget.
54+
- **`abstract-classes/draggable-widget.ts`** — Base class for draggable floating widgets.
55+
56+
All custom elements are registered in `index.ts`.
57+
58+
# Build System
59+
60+
- **Bundler**: Rollup (`rollup.config.js`)
61+
- **Build command**: `npm run build` (output to `dist/`)
62+
- **Dependencies**: React 18, Ant Design 5, CodeMirror 6, `@devtools-ds/*` for devtools UI, `@requestly/analytics-vendors` (local package).
63+
- **Preprocessor**: Uses PostCSS + Sass for styles.
64+
- **Pre-install hook**: Builds the analytics vendor package via `scripts/build-analytics-vendor.sh`.
65+
66+
# How MV3 Depends on Common
67+
68+
The MV3 extension imports from this package as `common/*` (resolved at build time to `../common/src/*`). Key imports:
69+
- `common/storage` — Storage abstraction
70+
- `common/rulesStore` — Rule retrieval and change listeners
71+
- `common/constants` — Message types and storage keys
72+
- `common/types` — TypeScript type definitions
73+
- `common/config` — Runtime config
74+
75+
The popup and devtools UIs are built separately by this package's Rollup config and output as HTML/JS bundles that the MV3 extension includes in its `dist/`.
76+
77+
# Development
78+
79+
- `npm run build` — Full build
80+
- `npm run watch` — Rollup watch mode
81+
- Changes here require rebuilding: from `../mv3/`, run `npm run build:common` or `npm run build` (which does both)

browser-extension/common/rollup.config.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,36 @@ export default [
127127
},
128128
plugins: [...commonPlugins, nodeResolve()],
129129
},
130+
{
131+
...commonConfig,
132+
input: "src/sidepanel/network-recording/index.tsx",
133+
output: {
134+
file: `${OUTPUT_DIR}/sidepanel/network-recording/index.js`,
135+
format: "iife",
136+
},
137+
context: "window",
138+
plugins: [
139+
copy({
140+
targets: [
141+
{
142+
src: "src/sidepanel/network-recording/index.html",
143+
dest: `${OUTPUT_DIR}/sidepanel/network-recording`,
144+
},
145+
],
146+
}),
147+
nodeResolve(),
148+
replace({
149+
preventAssignment: true,
150+
"process.env.NODE_ENV": JSON.stringify("production"),
151+
}),
152+
...commonPlugins,
153+
commonjs(),
154+
postcss({
155+
extract: true,
156+
}),
157+
svgr(),
158+
],
159+
},
130160
{
131161
...commonConfig,
132162
input: "src/custom-elements/index.ts",

browser-extension/common/src/constants.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,20 @@ export const EXTENSION_MESSAGES = {
4343
DESKTOP_APP_CONNECTION_STATUS_UPDATED: "desktopAppConnectionStatusUpdated",
4444
IS_SESSION_REPLAY_ENABLED: "isSessionReplayEnabled",
4545
TRIGGER_OPEN_CURL_MODAL: "triggerOpenCurlModal",
46+
STOP_NETWORK_RECORDING: "stopNetworkRecording",
47+
GET_NETWORK_RECORDING_STATE: "getNetworkRecordingState",
48+
// v2 body capture: SW → client content script → page script (networkBodyRecorder) start/stop.
49+
START_NETWORK_BODY_CAPTURE: "startNetworkBodyCapture",
50+
STOP_NETWORK_BODY_CAPTURE: "stopNetworkBodyCapture",
51+
// Floating widget: content script → SW request to reopen the closed side panel.
52+
REOPEN_NETWORK_RECORDING_PANEL: "reopenNetworkRecordingPanel",
4653
};
4754

4855
export const EXTENSION_EXTERNAL_MESSAGES = {
4956
GET_EXTENSION_METADATA: "getExtensionMetadata",
57+
START_NETWORK_RECORDING: "startNetworkRecording",
58+
STOP_NETWORK_RECORDING: "stopNetworkRecording",
59+
GET_NETWORK_RECORDING_SUMMARY: "getNetworkRecordingSummary",
5060
};
5161

5262
export const CLIENT_MESSAGES = {
@@ -72,6 +82,12 @@ export const CLIENT_MESSAGES = {
7282
NOTIFY_RECORD_UPDATED: "notifyRecordUpdated",
7383
NOTIFY_EXTENSION_STATUS_UPDATED: "notifyExtensionStatusUpdated",
7484
OPEN_CURL_IMPORT_MODAL: "openCurlImportModal",
85+
NETWORK_EVENT_CAPTURED: "networkEventCaptured",
86+
NETWORK_RECORDING_ENDED: "networkRecordingEnded",
87+
NETWORK_BODY_CAPTURED: "networkBodyCaptured",
88+
// Floating widget: SW → content script to show/hide the on-page reopen widget.
89+
SHOW_NETWORK_RECORDING_WIDGET: "showNetworkRecordingWidget",
90+
HIDE_NETWORK_RECORDING_WIDGET: "hideNetworkRecordingWidget",
7591
};
7692

7793
export const STORAGE_TYPE = "local";

browser-extension/common/src/custom-elements/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ import "./test-rule-widget/explicit-test-rule-widget";
55
import "./test-rule-widget/implicit-test-rule-widget";
66
import "./session-recording-widgets/draft-session-viewer";
77
import "./session-recording-widgets/post-session-save-widget";
8+
import "./network-recording-widget";
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
:host {
2+
position: fixed !important;
3+
z-index: 2147483647 !important;
4+
/* Shrink-wrap to content so the pill keeps its shape at the viewport edge instead of being
5+
squeezed by the fixed-position box (which caused the label/button to wrap). */
6+
width: max-content !important;
7+
max-width: max-content !important;
8+
}
9+
10+
#container {
11+
display: none;
12+
align-items: center;
13+
gap: 8px;
14+
background: #212121;
15+
color: #fff;
16+
border: 1px solid #333;
17+
border-radius: 8px;
18+
padding: 8px 12px;
19+
font-family: system-ui, -apple-system, sans-serif;
20+
font-size: 13px;
21+
line-height: 1.2;
22+
white-space: nowrap;
23+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
24+
cursor: grab;
25+
user-select: none;
26+
}
27+
28+
#container.visible {
29+
display: flex;
30+
}
31+
32+
.recording-dot {
33+
width: 8px;
34+
height: 8px;
35+
border-radius: 50%;
36+
background: #e43434;
37+
flex: none;
38+
animation: rq-nr-blink 1s cubic-bezier(0.5, 0, 1, 1) infinite alternate;
39+
}
40+
41+
@keyframes rq-nr-blink {
42+
from {
43+
opacity: 1;
44+
}
45+
to {
46+
opacity: 0.3;
47+
}
48+
}
49+
50+
.reopen {
51+
cursor: pointer;
52+
color: #4caf50;
53+
font-weight: 600;
54+
padding: 2px 8px;
55+
border-radius: 4px;
56+
flex: none;
57+
white-space: nowrap;
58+
}
59+
60+
.reopen:hover {
61+
background: rgba(76, 175, 80, 0.15);
62+
}

0 commit comments

Comments
 (0)