@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,229 +1,387 @@
|
|
|
1
|
-
<!
|
|
1
|
+
<!doctype html>
|
|
2
2
|
<html>
|
|
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
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
3
|
+
<head>
|
|
4
|
+
<title>Debug Proxy Errors</title>
|
|
5
|
+
<style>
|
|
6
|
+
body {
|
|
7
|
+
font-family: Arial, sans-serif;
|
|
8
|
+
padding: 20px;
|
|
9
|
+
max-width: 1000px;
|
|
10
|
+
}
|
|
11
|
+
.section {
|
|
12
|
+
margin: 20px 0;
|
|
13
|
+
padding: 20px;
|
|
14
|
+
border: 2px solid #ddd;
|
|
15
|
+
border-radius: 8px;
|
|
16
|
+
}
|
|
17
|
+
.error {
|
|
18
|
+
border-color: #dc3545;
|
|
19
|
+
background: #fff5f5;
|
|
20
|
+
}
|
|
21
|
+
.success {
|
|
22
|
+
border-color: #28a745;
|
|
23
|
+
background: #f8fff8;
|
|
24
|
+
}
|
|
25
|
+
.warning {
|
|
26
|
+
border-color: #ffc107;
|
|
27
|
+
background: #fffbf0;
|
|
28
|
+
}
|
|
29
|
+
.info {
|
|
30
|
+
border-color: #17a2b8;
|
|
31
|
+
background: #f0f9ff;
|
|
32
|
+
}
|
|
33
|
+
.code {
|
|
34
|
+
background: #e9ecef;
|
|
35
|
+
padding: 8px;
|
|
36
|
+
font-family: monospace;
|
|
37
|
+
margin: 8px 0;
|
|
38
|
+
word-break: break-all;
|
|
39
|
+
}
|
|
40
|
+
.results {
|
|
41
|
+
background: #f5f5f5;
|
|
42
|
+
padding: 10px;
|
|
43
|
+
margin: 10px 0;
|
|
44
|
+
border-radius: 4px;
|
|
45
|
+
max-height: 300px;
|
|
46
|
+
overflow-y: auto;
|
|
47
|
+
}
|
|
48
|
+
button {
|
|
49
|
+
padding: 10px 15px;
|
|
50
|
+
margin: 5px;
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
background: #007bff;
|
|
53
|
+
color: white;
|
|
54
|
+
border: none;
|
|
55
|
+
border-radius: 4px;
|
|
56
|
+
}
|
|
57
|
+
.error-btn {
|
|
58
|
+
background: #dc3545;
|
|
59
|
+
}
|
|
60
|
+
.success-btn {
|
|
61
|
+
background: #28a745;
|
|
62
|
+
}
|
|
63
|
+
table {
|
|
64
|
+
width: 100%;
|
|
65
|
+
border-collapse: collapse;
|
|
66
|
+
margin: 10px 0;
|
|
67
|
+
}
|
|
68
|
+
th,
|
|
69
|
+
td {
|
|
70
|
+
border: 1px solid #ddd;
|
|
71
|
+
padding: 8px;
|
|
72
|
+
text-align: left;
|
|
73
|
+
}
|
|
74
|
+
th {
|
|
75
|
+
background: #f8f9fa;
|
|
76
|
+
}
|
|
77
|
+
</style>
|
|
78
|
+
</head>
|
|
79
|
+
<body>
|
|
80
|
+
<h1>🐛 Debug Proxy Errors</h1>
|
|
81
|
+
|
|
82
|
+
<div class="section error">
|
|
83
|
+
<h2>❌ Common Firefox Errors</h2>
|
|
84
|
+
<table>
|
|
85
|
+
<tr>
|
|
86
|
+
<th>Error</th>
|
|
87
|
+
<th>Meaning</th>
|
|
88
|
+
<th>Common Causes</th>
|
|
89
|
+
</tr>
|
|
90
|
+
<tr>
|
|
91
|
+
<td><code>ns_binding_aborted</code></td>
|
|
92
|
+
<td>Network request was cancelled</td>
|
|
93
|
+
<td>Redirect loops, Invalid redirects, Extension conflicts</td>
|
|
94
|
+
</tr>
|
|
95
|
+
<tr>
|
|
96
|
+
<td><code>ns_error_corrupted_content</code></td>
|
|
97
|
+
<td>Content corruption or invalid response</td>
|
|
98
|
+
<td>Header issues, CORS problems, Content-encoding conflicts</td>
|
|
99
|
+
</tr>
|
|
100
|
+
<tr>
|
|
101
|
+
<td><code>ns_error_net_reset</code></td>
|
|
102
|
+
<td>Connection was reset</td>
|
|
103
|
+
<td>Server rejection, Proxy server issues</td>
|
|
104
|
+
</tr>
|
|
105
|
+
</table>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<div class="section warning">
|
|
109
|
+
<h2>⚠️ Quick Fixes</h2>
|
|
110
|
+
<ol>
|
|
111
|
+
<li>
|
|
112
|
+
<strong>Check for redirect loops:</strong> Make sure your redirect
|
|
113
|
+
target doesn't match your pattern
|
|
114
|
+
</li>
|
|
115
|
+
<li>
|
|
116
|
+
<strong>Use redirect mode first:</strong> Disable "Mask URL" to test
|
|
117
|
+
basic functionality
|
|
118
|
+
</li>
|
|
119
|
+
<li>
|
|
120
|
+
<strong>Test with simple domains:</strong> Try redirecting to a known
|
|
121
|
+
working server first
|
|
122
|
+
</li>
|
|
123
|
+
<li>
|
|
124
|
+
<strong>Check proxy server:</strong> Ensure your target server can
|
|
125
|
+
handle the requests
|
|
126
|
+
</li>
|
|
127
|
+
</ol>
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<div class="section info">
|
|
131
|
+
<h2>🔍 Diagnostic Tests</h2>
|
|
132
|
+
<button onclick="checkExtensionStatus()">Check Extension Status</button>
|
|
133
|
+
<button onclick="testSimpleRedirect()">Test Simple Redirect</button>
|
|
134
|
+
<button onclick="testProblematicURL()">Test Problematic URL</button>
|
|
135
|
+
<button onclick="analyzeRules()">Analyze Rules for Loops</button>
|
|
136
|
+
<button class="error-btn" onclick="clearLogs()">Clear Logs</button>
|
|
137
|
+
<div id="diagnosticResults" class="results"></div>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
<div class="section success">
|
|
141
|
+
<h2>✅ Troubleshooting Steps</h2>
|
|
142
|
+
<div id="troubleshootingSteps">
|
|
143
|
+
<h3>Step 1: Verify Extension State</h3>
|
|
144
|
+
<button onclick="runTroubleshootingStep(1)">Run Step 1</button>
|
|
145
|
+
<div id="step1Results" class="results"></div>
|
|
146
|
+
|
|
147
|
+
<h3>Step 2: Test Without Masking</h3>
|
|
148
|
+
<button onclick="runTroubleshootingStep(2)">Run Step 2</button>
|
|
149
|
+
<div id="step2Results" class="results"></div>
|
|
150
|
+
|
|
151
|
+
<h3>Step 3: Check for Redirect Loops</h3>
|
|
152
|
+
<button onclick="runTroubleshootingStep(3)">Run Step 3</button>
|
|
153
|
+
<div id="step3Results" class="results"></div>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
<script>
|
|
158
|
+
function log(elementId, message, type = "info") {
|
|
159
|
+
const element = document.getElementById(elementId)
|
|
160
|
+
const timestamp = new Date().toLocaleTimeString()
|
|
161
|
+
const icon =
|
|
162
|
+
type === "error"
|
|
163
|
+
? "❌"
|
|
164
|
+
: type === "success"
|
|
165
|
+
? "✅"
|
|
166
|
+
: type === "warning"
|
|
167
|
+
? "⚠️"
|
|
168
|
+
: "ℹ️"
|
|
169
|
+
element.innerHTML += `<div>${timestamp} ${icon} ${message}</div>`
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function clearLogs() {
|
|
173
|
+
const logElements = [
|
|
174
|
+
"diagnosticResults",
|
|
175
|
+
"step1Results",
|
|
176
|
+
"step2Results",
|
|
177
|
+
"step3Results",
|
|
178
|
+
]
|
|
179
|
+
logElements.forEach((id) => {
|
|
180
|
+
const element = document.getElementById(id)
|
|
181
|
+
if (element) element.innerHTML = ""
|
|
182
|
+
})
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
async function checkExtensionStatus() {
|
|
186
|
+
log("diagnosticResults", "Checking extension status...")
|
|
187
|
+
|
|
188
|
+
try {
|
|
189
|
+
if (typeof browser === "undefined") {
|
|
190
|
+
log(
|
|
191
|
+
"diagnosticResults",
|
|
192
|
+
"Browser API not available - extension not loaded",
|
|
193
|
+
"error",
|
|
194
|
+
)
|
|
195
|
+
return
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const state = await browser.runtime.sendMessage({
|
|
199
|
+
action: "getState",
|
|
200
|
+
})
|
|
201
|
+
log(
|
|
202
|
+
"diagnosticResults",
|
|
203
|
+
`Extension enabled: ${state.enabled}`,
|
|
204
|
+
"success",
|
|
205
|
+
)
|
|
206
|
+
log(
|
|
207
|
+
"diagnosticResults",
|
|
208
|
+
`Number of rules: ${state.rules.length}`,
|
|
209
|
+
"info",
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
state.rules.forEach((rule, index) => {
|
|
213
|
+
log(
|
|
214
|
+
"diagnosticResults",
|
|
215
|
+
`Rule ${index + 1}: ${rule.pattern} → ${rule.redirect} (Mask: ${rule.maskUrl || false})`,
|
|
216
|
+
"info",
|
|
217
|
+
)
|
|
218
|
+
})
|
|
219
|
+
} catch (error) {
|
|
220
|
+
log(
|
|
221
|
+
"diagnosticResults",
|
|
222
|
+
`Extension communication failed: ${error.message}`,
|
|
223
|
+
"error",
|
|
224
|
+
)
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
async function testSimpleRedirect() {
|
|
229
|
+
log(
|
|
230
|
+
"diagnosticResults",
|
|
231
|
+
"Testing simple redirect with known good server...",
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
try {
|
|
235
|
+
// Test with a simple, reliable endpoint
|
|
236
|
+
const response = await fetch("https://httpbin.org/get?test=simple")
|
|
237
|
+
const data = await response.json()
|
|
238
|
+
log(
|
|
239
|
+
"diagnosticResults",
|
|
240
|
+
`Simple test successful: ${response.status}`,
|
|
241
|
+
"success",
|
|
242
|
+
)
|
|
243
|
+
log("diagnosticResults", `Response URL: ${data.url}`, "info")
|
|
244
|
+
} catch (error) {
|
|
245
|
+
log(
|
|
246
|
+
"diagnosticResults",
|
|
247
|
+
`Simple test failed: ${error.message}`,
|
|
248
|
+
"error",
|
|
249
|
+
)
|
|
250
|
+
log(
|
|
251
|
+
"diagnosticResults",
|
|
252
|
+
"This suggests a configuration issue with your rules",
|
|
253
|
+
"warning",
|
|
254
|
+
)
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
async function testProblematicURL() {
|
|
259
|
+
log(
|
|
260
|
+
"diagnosticResults",
|
|
261
|
+
"Testing the problematic gramercy.cloud URL...",
|
|
262
|
+
)
|
|
263
|
+
|
|
264
|
+
const testUrl =
|
|
265
|
+
"https://hilton-pop-art-cytz-dani-martin-hueg.gramercy.cloud/uploads/assets/test.png"
|
|
266
|
+
|
|
267
|
+
try {
|
|
268
|
+
const response = await fetch(testUrl)
|
|
269
|
+
log(
|
|
270
|
+
"diagnosticResults",
|
|
271
|
+
`Gramercy test: ${response.status} ${response.statusText}`,
|
|
272
|
+
"success",
|
|
273
|
+
)
|
|
274
|
+
} catch (error) {
|
|
275
|
+
log(
|
|
276
|
+
"diagnosticResults",
|
|
277
|
+
`Gramercy test failed: ${error.message}`,
|
|
278
|
+
"error",
|
|
279
|
+
)
|
|
280
|
+
|
|
281
|
+
if (error.message.includes("ns_binding_aborted")) {
|
|
282
|
+
log(
|
|
283
|
+
"diagnosticResults",
|
|
284
|
+
"→ Likely cause: Redirect loop or invalid redirect target",
|
|
285
|
+
"warning",
|
|
286
|
+
)
|
|
287
|
+
} else if (error.message.includes("ns_error_corrupted_content")) {
|
|
288
|
+
log(
|
|
289
|
+
"diagnosticResults",
|
|
290
|
+
"→ Likely cause: Header modification issues or server response problems",
|
|
291
|
+
"warning",
|
|
292
|
+
)
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
async function analyzeRules() {
|
|
298
|
+
log("diagnosticResults", "Analyzing rules for potential problems...")
|
|
299
|
+
|
|
300
|
+
try {
|
|
301
|
+
const state = await browser.runtime.sendMessage({
|
|
302
|
+
action: "getState",
|
|
303
|
+
})
|
|
304
|
+
const rules = state.rules
|
|
305
|
+
|
|
306
|
+
if (rules.length === 0) {
|
|
307
|
+
log("diagnosticResults", "No rules configured", "warning")
|
|
308
|
+
return
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// Check for redirect loops
|
|
312
|
+
rules.forEach((rule, index) => {
|
|
313
|
+
const pattern = new RegExp(rule.pattern, "i")
|
|
314
|
+
|
|
315
|
+
// Check if redirect target matches the pattern
|
|
316
|
+
if (pattern.test(rule.redirect)) {
|
|
317
|
+
log(
|
|
318
|
+
"diagnosticResults",
|
|
319
|
+
`⚠️ LOOP DETECTED: Rule ${index + 1} redirects to a domain that matches its own pattern!`,
|
|
320
|
+
"error",
|
|
321
|
+
)
|
|
322
|
+
log("diagnosticResults", ` Pattern: ${rule.pattern}`, "error")
|
|
323
|
+
log("diagnosticResults", ` Redirect: ${rule.redirect}`, "error")
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// Check if redirect target matches other patterns
|
|
327
|
+
rules.forEach((otherRule, otherIndex) => {
|
|
328
|
+
if (index !== otherIndex) {
|
|
329
|
+
const otherPattern = new RegExp(otherRule.pattern, "i")
|
|
330
|
+
if (otherPattern.test(rule.redirect)) {
|
|
331
|
+
log(
|
|
332
|
+
"diagnosticResults",
|
|
333
|
+
`⚠️ CHAIN DETECTED: Rule ${index + 1} redirects to domain that matches Rule ${otherIndex + 1}`,
|
|
334
|
+
"warning",
|
|
335
|
+
)
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
})
|
|
339
|
+
})
|
|
340
|
+
|
|
341
|
+
log("diagnosticResults", "Rule analysis complete", "success")
|
|
342
|
+
} catch (error) {
|
|
343
|
+
log(
|
|
344
|
+
"diagnosticResults",
|
|
345
|
+
`Rule analysis failed: ${error.message}`,
|
|
346
|
+
"error",
|
|
347
|
+
)
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
async function runTroubleshootingStep(step) {
|
|
352
|
+
const resultId = `step${step}Results`
|
|
353
|
+
|
|
354
|
+
switch (step) {
|
|
355
|
+
case 1:
|
|
356
|
+
log(resultId, "Verifying extension state...")
|
|
357
|
+
await checkExtensionStatus()
|
|
358
|
+
break
|
|
359
|
+
|
|
360
|
+
case 2:
|
|
361
|
+
log(resultId, "Testing redirect mode (non-masking)...")
|
|
362
|
+
log(
|
|
363
|
+
resultId,
|
|
364
|
+
'1. Disable all "Mask URL" checkboxes in extension popup',
|
|
365
|
+
"info",
|
|
366
|
+
)
|
|
367
|
+
log(resultId, '2. Disable "URL Masking Mode" toggle', "info")
|
|
368
|
+
log(resultId, "3. Try your request again", "info")
|
|
369
|
+
log(
|
|
370
|
+
resultId,
|
|
371
|
+
"4. If it works, the issue is with masking mode",
|
|
372
|
+
"warning",
|
|
373
|
+
)
|
|
374
|
+
break
|
|
375
|
+
|
|
376
|
+
case 3:
|
|
377
|
+
log(resultId, "Checking for redirect loops...")
|
|
378
|
+
await analyzeRules()
|
|
379
|
+
break
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// Auto-run extension check on page load
|
|
384
|
+
window.addEventListener("load", checkExtensionStatus)
|
|
385
|
+
</script>
|
|
386
|
+
</body>
|
|
387
|
+
</html>
|