@gxp-dev/tools 2.0.63 → 2.0.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -31
- package/bin/gx-devtools.js +74 -54
- package/bin/lib/cli.js +23 -21
- package/bin/lib/commands/add-dependency.js +366 -325
- package/bin/lib/commands/assets.js +137 -139
- package/bin/lib/commands/build.js +169 -174
- package/bin/lib/commands/datastore.js +181 -183
- package/bin/lib/commands/dev.js +127 -131
- package/bin/lib/commands/extensions.js +147 -149
- package/bin/lib/commands/extract-config.js +73 -67
- package/bin/lib/commands/index.js +12 -12
- package/bin/lib/commands/init.js +342 -240
- package/bin/lib/commands/publish.js +69 -75
- package/bin/lib/commands/socket.js +69 -69
- package/bin/lib/commands/ssl.js +14 -14
- package/bin/lib/constants.js +10 -24
- package/bin/lib/tui/App.tsx +761 -705
- package/bin/lib/tui/components/AIPanel.tsx +191 -171
- package/bin/lib/tui/components/CommandInput.tsx +394 -343
- package/bin/lib/tui/components/GeminiPanel.tsx +175 -151
- package/bin/lib/tui/components/Header.tsx +23 -21
- package/bin/lib/tui/components/LogPanel.tsx +244 -220
- package/bin/lib/tui/components/TabBar.tsx +50 -48
- package/bin/lib/tui/components/WelcomeScreen.tsx +126 -71
- package/bin/lib/tui/index.tsx +37 -39
- package/bin/lib/tui/services/AIService.ts +518 -462
- package/bin/lib/tui/services/ExtensionService.ts +140 -129
- package/bin/lib/tui/services/GeminiService.ts +367 -337
- package/bin/lib/tui/services/ServiceManager.ts +344 -322
- package/bin/lib/tui/services/SocketService.ts +168 -168
- package/bin/lib/tui/services/ViteService.ts +88 -88
- package/bin/lib/tui/services/index.ts +47 -22
- package/bin/lib/utils/ai-scaffold.js +291 -280
- package/bin/lib/utils/extract-config.js +157 -140
- package/bin/lib/utils/files.js +82 -86
- package/bin/lib/utils/index.js +7 -7
- package/bin/lib/utils/paths.js +34 -34
- package/bin/lib/utils/prompts.js +194 -169
- package/bin/lib/utils/ssl.js +79 -81
- package/browser-extensions/README.md +0 -1
- package/browser-extensions/chrome/background.js +244 -237
- package/browser-extensions/chrome/content.js +32 -29
- package/browser-extensions/chrome/devtools.html +7 -7
- package/browser-extensions/chrome/devtools.js +19 -19
- package/browser-extensions/chrome/inspector.js +802 -767
- package/browser-extensions/chrome/manifest.json +71 -63
- package/browser-extensions/chrome/panel.html +674 -636
- package/browser-extensions/chrome/panel.js +722 -712
- package/browser-extensions/chrome/popup.html +586 -543
- package/browser-extensions/chrome/popup.js +282 -244
- package/browser-extensions/chrome/rules.json +1 -1
- package/browser-extensions/chrome/test-chrome.html +216 -136
- package/browser-extensions/chrome/test-mixed-content.html +284 -189
- package/browser-extensions/chrome/test-uri-pattern.html +221 -198
- package/browser-extensions/firefox/README.md +9 -6
- package/browser-extensions/firefox/background.js +221 -218
- package/browser-extensions/firefox/content.js +55 -52
- package/browser-extensions/firefox/debug-errors.html +386 -228
- package/browser-extensions/firefox/debug-https.html +153 -105
- package/browser-extensions/firefox/devtools.html +7 -7
- package/browser-extensions/firefox/devtools.js +23 -20
- package/browser-extensions/firefox/inspector.js +802 -767
- package/browser-extensions/firefox/manifest.json +68 -68
- package/browser-extensions/firefox/panel.html +674 -636
- package/browser-extensions/firefox/panel.js +722 -712
- package/browser-extensions/firefox/popup.html +572 -535
- package/browser-extensions/firefox/popup.js +281 -236
- package/browser-extensions/firefox/test-gramercy.html +170 -125
- package/browser-extensions/firefox/test-imports.html +59 -55
- package/browser-extensions/firefox/test-masking.html +231 -140
- package/browser-extensions/firefox/test-uri-pattern.html +221 -198
- package/dist/tui/App.d.ts +1 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +154 -150
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/components/AIPanel.d.ts.map +1 -1
- package/dist/tui/components/AIPanel.js +42 -35
- package/dist/tui/components/AIPanel.js.map +1 -1
- package/dist/tui/components/CommandInput.d.ts +1 -1
- package/dist/tui/components/CommandInput.d.ts.map +1 -1
- package/dist/tui/components/CommandInput.js +92 -62
- package/dist/tui/components/CommandInput.js.map +1 -1
- package/dist/tui/components/GeminiPanel.d.ts.map +1 -1
- package/dist/tui/components/GeminiPanel.js +37 -30
- package/dist/tui/components/GeminiPanel.js.map +1 -1
- package/dist/tui/components/Header.d.ts.map +1 -1
- package/dist/tui/components/Header.js +1 -1
- package/dist/tui/components/Header.js.map +1 -1
- package/dist/tui/components/LogPanel.d.ts +1 -1
- package/dist/tui/components/LogPanel.d.ts.map +1 -1
- package/dist/tui/components/LogPanel.js +26 -24
- package/dist/tui/components/LogPanel.js.map +1 -1
- package/dist/tui/components/TabBar.d.ts +2 -2
- package/dist/tui/components/TabBar.d.ts.map +1 -1
- package/dist/tui/components/TabBar.js +11 -11
- package/dist/tui/components/TabBar.js.map +1 -1
- package/dist/tui/components/WelcomeScreen.d.ts.map +1 -1
- package/dist/tui/components/WelcomeScreen.js +6 -6
- package/dist/tui/components/WelcomeScreen.js.map +1 -1
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/index.js +8 -8
- package/dist/tui/index.js.map +1 -1
- package/dist/tui/services/AIService.d.ts +2 -2
- package/dist/tui/services/AIService.d.ts.map +1 -1
- package/dist/tui/services/AIService.js +165 -125
- package/dist/tui/services/AIService.js.map +1 -1
- package/dist/tui/services/ExtensionService.d.ts +1 -1
- package/dist/tui/services/ExtensionService.d.ts.map +1 -1
- package/dist/tui/services/ExtensionService.js +33 -26
- package/dist/tui/services/ExtensionService.js.map +1 -1
- package/dist/tui/services/GeminiService.d.ts +1 -1
- package/dist/tui/services/GeminiService.d.ts.map +1 -1
- package/dist/tui/services/GeminiService.js +87 -76
- package/dist/tui/services/GeminiService.js.map +1 -1
- package/dist/tui/services/ServiceManager.d.ts +3 -3
- package/dist/tui/services/ServiceManager.d.ts.map +1 -1
- package/dist/tui/services/ServiceManager.js +72 -58
- package/dist/tui/services/ServiceManager.js.map +1 -1
- package/dist/tui/services/SocketService.d.ts.map +1 -1
- package/dist/tui/services/SocketService.js +32 -32
- package/dist/tui/services/SocketService.js.map +1 -1
- package/dist/tui/services/ViteService.d.ts.map +1 -1
- package/dist/tui/services/ViteService.js +26 -28
- package/dist/tui/services/ViteService.js.map +1 -1
- package/dist/tui/services/index.d.ts +6 -6
- package/dist/tui/services/index.d.ts.map +1 -1
- package/dist/tui/services/index.js +6 -6
- package/dist/tui/services/index.js.map +1 -1
- package/mcp/gxp-api-server.js +83 -81
- package/package.json +109 -93
- package/runtime/PortalContainer.vue +258 -234
- package/runtime/dev-tools/DevToolsModal.vue +153 -155
- package/runtime/dev-tools/LayoutSwitcher.vue +144 -140
- package/runtime/dev-tools/MockDataEditor.vue +456 -433
- package/runtime/dev-tools/SocketSimulator.vue +379 -371
- package/runtime/dev-tools/StoreInspector.vue +517 -455
- package/runtime/dev-tools/index.js +5 -5
- package/runtime/fallback-layouts/PrivateLayout.vue +2 -2
- package/runtime/fallback-layouts/PublicLayout.vue +2 -2
- package/runtime/fallback-layouts/SystemLayout.vue +2 -2
- package/runtime/gxpStringsPlugin.js +159 -134
- package/runtime/index.html +17 -19
- package/runtime/main.js +24 -22
- package/runtime/mock-api/auth-middleware.js +15 -15
- package/runtime/mock-api/image-generator.js +46 -46
- package/runtime/mock-api/index.js +55 -55
- package/runtime/mock-api/response-generator.js +116 -105
- package/runtime/mock-api/route-generator.js +107 -84
- package/runtime/mock-api/socket-triggers.js +94 -93
- package/runtime/mock-api/spec-loader.js +79 -80
- package/runtime/package.json +3 -0
- package/runtime/server.js +68 -68
- package/runtime/stores/gxpPortalConfigStore.js +204 -186
- package/runtime/stores/index.js +2 -2
- package/runtime/vite-inspector-plugin.js +858 -707
- package/runtime/vite-source-tracker-plugin.js +132 -113
- package/runtime/vite.config.js +191 -139
- package/scripts/launch-chrome.js +41 -41
- package/scripts/pack-chrome.js +38 -39
- package/socket-events/AiSessionMessageCreated.json +17 -17
- package/socket-events/SocialStreamPostCreated.json +23 -23
- package/socket-events/SocialStreamPostVariantCompleted.json +22 -22
- package/template/.claude/agents/gxp-developer.md +100 -99
- package/template/.claude/settings.json +7 -7
- package/template/AGENTS.md +30 -23
- package/template/GEMINI.md +20 -20
- package/template/README.md +70 -53
- package/template/app-manifest.json +2 -4
- package/template/configuration.json +10 -10
- package/template/default-styling.css +1 -1
- package/template/index.html +18 -20
- package/template/main.js +24 -22
- package/template/src/DemoPage.vue +415 -362
- package/template/src/Plugin.vue +76 -85
- package/template/src/stores/index.js +3 -3
- package/template/src/stores/test-data.json +164 -172
- package/template/theme-layouts/AdditionalStyling.css +50 -50
- package/template/theme-layouts/PrivateLayout.vue +8 -12
- package/template/theme-layouts/PublicLayout.vue +8 -12
- package/template/theme-layouts/SystemLayout.vue +8 -12
- package/template/vite.extend.js +45 -0
- package/template/vite.config.js +0 -409
|
@@ -1,199 +1,222 @@
|
|
|
1
|
-
<!
|
|
1
|
+
<!doctype html>
|
|
2
2
|
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
</
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>JavaScript Proxy URI Pattern Test</title>
|
|
7
|
+
<style>
|
|
8
|
+
body {
|
|
9
|
+
font-family:
|
|
10
|
+
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
11
|
+
max-width: 800px;
|
|
12
|
+
margin: 0 auto;
|
|
13
|
+
padding: 20px;
|
|
14
|
+
background: #f8f9fa;
|
|
15
|
+
}
|
|
16
|
+
.container {
|
|
17
|
+
background: white;
|
|
18
|
+
padding: 30px;
|
|
19
|
+
border-radius: 8px;
|
|
20
|
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
21
|
+
}
|
|
22
|
+
h1 {
|
|
23
|
+
color: #333;
|
|
24
|
+
margin-bottom: 30px;
|
|
25
|
+
}
|
|
26
|
+
.test-section {
|
|
27
|
+
margin-bottom: 30px;
|
|
28
|
+
padding: 20px;
|
|
29
|
+
border: 1px solid #e9ecef;
|
|
30
|
+
border-radius: 6px;
|
|
31
|
+
}
|
|
32
|
+
.test-section h3 {
|
|
33
|
+
margin-top: 0;
|
|
34
|
+
color: #495057;
|
|
35
|
+
}
|
|
36
|
+
.url-test {
|
|
37
|
+
margin: 10px 0;
|
|
38
|
+
padding: 10px;
|
|
39
|
+
background: #f8f9fa;
|
|
40
|
+
border-left: 4px solid #007bff;
|
|
41
|
+
font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
|
|
42
|
+
font-size: 13px;
|
|
43
|
+
word-break: break-all;
|
|
44
|
+
}
|
|
45
|
+
.should-match {
|
|
46
|
+
border-left-color: #28a745;
|
|
47
|
+
}
|
|
48
|
+
.should-not-match {
|
|
49
|
+
border-left-color: #dc3545;
|
|
50
|
+
}
|
|
51
|
+
button {
|
|
52
|
+
background: #007bff;
|
|
53
|
+
color: white;
|
|
54
|
+
border: none;
|
|
55
|
+
padding: 10px 20px;
|
|
56
|
+
border-radius: 4px;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
margin: 5px;
|
|
59
|
+
}
|
|
60
|
+
button:hover {
|
|
61
|
+
background: #0056b3;
|
|
62
|
+
}
|
|
63
|
+
.status {
|
|
64
|
+
margin-top: 20px;
|
|
65
|
+
padding: 15px;
|
|
66
|
+
border-radius: 4px;
|
|
67
|
+
font-weight: bold;
|
|
68
|
+
}
|
|
69
|
+
.success {
|
|
70
|
+
background: #d4edda;
|
|
71
|
+
color: #155724;
|
|
72
|
+
border: 1px solid #c3e6cb;
|
|
73
|
+
}
|
|
74
|
+
.error {
|
|
75
|
+
background: #f8d7da;
|
|
76
|
+
color: #721c24;
|
|
77
|
+
border: 1px solid #f5c6cb;
|
|
78
|
+
}
|
|
79
|
+
</style>
|
|
80
|
+
</head>
|
|
81
|
+
<body>
|
|
82
|
+
<div class="container">
|
|
83
|
+
<h1>JavaScript Proxy URI Pattern Test</h1>
|
|
84
|
+
|
|
85
|
+
<div class="test-section">
|
|
86
|
+
<h3>Default Pattern</h3>
|
|
87
|
+
<p>
|
|
88
|
+
Default pattern:
|
|
89
|
+
<code>uploads\/plugin-version\/\d+\/file_name\/.*\.js(\?.*)?</code>
|
|
90
|
+
</p>
|
|
91
|
+
<p>
|
|
92
|
+
This should match JavaScript files in the uploads/plugin-version/*
|
|
93
|
+
path on any domain.
|
|
94
|
+
</p>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<div class="test-section">
|
|
98
|
+
<h3>URLs That Should Match (Will Redirect)</h3>
|
|
99
|
+
|
|
100
|
+
<div class="url-test should-match">
|
|
101
|
+
https://example.com/uploads/plugin-version/123/file_name/script.js
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<div class="url-test should-match">
|
|
105
|
+
https://westernightwall.zenith-develop.env.eventfinity.app/uploads/plugin-version/3/file_name/T9OvqS1727804478.js
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<div class="url-test should-match">
|
|
109
|
+
https://different-domain.com/uploads/plugin-version/456/file_name/myfile.js?signature=abc123&expires=789
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
<div class="url-test should-match">
|
|
113
|
+
https://api.staging.example.org/uploads/plugin-version/999/file_name/component.js?token=xyz
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<div class="test-section">
|
|
118
|
+
<h3>URLs That Should NOT Match (No Redirect)</h3>
|
|
119
|
+
|
|
120
|
+
<div class="url-test should-not-match">
|
|
121
|
+
https://example.com/uploads/versions/123/file_name/script.js
|
|
122
|
+
<small>(different path: versions instead of plugin-version)</small>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
<div class="url-test should-not-match">
|
|
126
|
+
https://example.com/uploads/plugin-version/123/file_name/style.css
|
|
127
|
+
<small>(not a .js file)</small>
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<div class="url-test should-not-match">
|
|
131
|
+
https://example.com/other-path/plugin-version/123/file_name/script.js
|
|
132
|
+
<small>(wrong base path)</small>
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
<div class="url-test should-not-match">
|
|
136
|
+
https://localhost:3060/src/Plugin.vue
|
|
137
|
+
<small>(localhost - prevent redirect loops)</small>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
<div class="test-section">
|
|
142
|
+
<h3>Test Actions</h3>
|
|
143
|
+
<p>Click the buttons below to test loading JavaScript files:</p>
|
|
144
|
+
|
|
145
|
+
<button
|
|
146
|
+
onclick="
|
|
147
|
+
testUrl(
|
|
148
|
+
'https://example.com/uploads/plugin-version/123/file_name/test.js',
|
|
149
|
+
)
|
|
150
|
+
"
|
|
151
|
+
>
|
|
152
|
+
Test Matching URL
|
|
153
|
+
</button>
|
|
154
|
+
|
|
155
|
+
<button
|
|
156
|
+
onclick="
|
|
157
|
+
testUrl(
|
|
158
|
+
'https://example.com/uploads/plugin-version/456/file_name/test.js?signed=true',
|
|
159
|
+
)
|
|
160
|
+
"
|
|
161
|
+
>
|
|
162
|
+
Test Matching URL with Query
|
|
163
|
+
</button>
|
|
164
|
+
|
|
165
|
+
<button onclick="testUrl('https://example.com/other-path/test.js')">
|
|
166
|
+
Test Non-Matching URL
|
|
167
|
+
</button>
|
|
168
|
+
|
|
169
|
+
<div id="status"></div>
|
|
170
|
+
</div>
|
|
171
|
+
|
|
172
|
+
<div class="test-section">
|
|
173
|
+
<h3>Instructions</h3>
|
|
174
|
+
<ol>
|
|
175
|
+
<li>Install and enable the JavaScript Proxy extension</li>
|
|
176
|
+
<li>Configure it to redirect to your local development server</li>
|
|
177
|
+
<li>Open browser developer tools to see network requests</li>
|
|
178
|
+
<li>Click the test buttons above to see which URLs get redirected</li>
|
|
179
|
+
<li>
|
|
180
|
+
URLs matching the pattern should redirect to your local server
|
|
181
|
+
</li>
|
|
182
|
+
<li>URLs not matching should load normally (and probably fail)</li>
|
|
183
|
+
</ol>
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
|
|
187
|
+
<script>
|
|
188
|
+
function testUrl(url) {
|
|
189
|
+
const status = document.getElementById("status")
|
|
190
|
+
status.innerHTML = `<div class="status">Testing: ${url}</div>`
|
|
191
|
+
|
|
192
|
+
// Create a script element to test the URL
|
|
193
|
+
const script = document.createElement("script")
|
|
194
|
+
script.src = url
|
|
195
|
+
|
|
196
|
+
script.onload = function () {
|
|
197
|
+
status.innerHTML = `<div class="status success">✅ Successfully loaded: ${url}</div>`
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
script.onerror = function () {
|
|
201
|
+
status.innerHTML = `<div class="status error">❌ Failed to load: ${url}<br><small>This is expected for test URLs that don't exist</small></div>`
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Add to page to trigger the request
|
|
205
|
+
document.head.appendChild(script)
|
|
206
|
+
|
|
207
|
+
// Remove after a short delay
|
|
208
|
+
setTimeout(() => {
|
|
209
|
+
if (script.parentNode) {
|
|
210
|
+
script.parentNode.removeChild(script)
|
|
211
|
+
}
|
|
212
|
+
}, 5000)
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// Log current page URL for reference
|
|
216
|
+
console.log("Test page URL:", window.location.href)
|
|
217
|
+
console.log(
|
|
218
|
+
"Use browser dev tools to monitor network requests and see proxy behavior",
|
|
219
|
+
)
|
|
220
|
+
</script>
|
|
221
|
+
</body>
|
|
222
|
+
</html>
|
|
@@ -58,11 +58,11 @@ Alternatively, use an online SVG to PNG converter for the files in `icons/`.
|
|
|
58
58
|
|
|
59
59
|
### Example Rules
|
|
60
60
|
|
|
61
|
-
| Pattern
|
|
62
|
-
|
|
63
|
-
| `api\.example\.com`
|
|
64
|
-
| `.*\.googleapis\.com` | `api.myproxy.com`
|
|
65
|
-
| `cdn\.jsdelivr\.net`
|
|
61
|
+
| Pattern | Redirect To | Description |
|
|
62
|
+
| --------------------- | --------------------- | ---------------------------------------------------------- |
|
|
63
|
+
| `api\.example\.com` | `api.alternative.com` | Redirect all API calls from example.com to alternative.com |
|
|
64
|
+
| `.*\.googleapis\.com` | `api.myproxy.com` | Redirect all Google API calls to your proxy server |
|
|
65
|
+
| `cdn\.jsdelivr\.net` | `my-cdn.example.com` | Redirect CDN requests to your own server |
|
|
66
66
|
|
|
67
67
|
## How It Works
|
|
68
68
|
|
|
@@ -115,20 +115,23 @@ The extension requires the following permissions:
|
|
|
115
115
|
## Troubleshooting
|
|
116
116
|
|
|
117
117
|
### Extension Not Working
|
|
118
|
+
|
|
118
119
|
- Check that the extension is enabled in `about:addons`
|
|
119
120
|
- Verify permissions are granted
|
|
120
121
|
- Check browser console for errors
|
|
121
122
|
|
|
122
123
|
### Icons Not Showing
|
|
124
|
+
|
|
123
125
|
- Ensure PNG icon files exist in the `icons/` directory
|
|
124
126
|
- Convert SVG files to PNG if needed
|
|
125
127
|
- Check file permissions
|
|
126
128
|
|
|
127
129
|
### Rules Not Matching
|
|
130
|
+
|
|
128
131
|
- Test regex patterns using online regex testers
|
|
129
132
|
- Ensure domains are properly escaped (use `\.` for literal dots)
|
|
130
133
|
- Check that the proxy is enabled (green button)
|
|
131
134
|
|
|
132
135
|
## License
|
|
133
136
|
|
|
134
|
-
This extension is provided as-is for educational and development purposes.
|
|
137
|
+
This extension is provided as-is for educational and development purposes.
|