@gxp-dev/tools 2.0.62 → 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.
Files changed (182) hide show
  1. package/README.md +32 -31
  2. package/bin/gx-devtools.js +74 -54
  3. package/bin/lib/cli.js +23 -21
  4. package/bin/lib/commands/add-dependency.js +366 -325
  5. package/bin/lib/commands/assets.js +137 -139
  6. package/bin/lib/commands/build.js +169 -174
  7. package/bin/lib/commands/datastore.js +181 -183
  8. package/bin/lib/commands/dev.js +127 -131
  9. package/bin/lib/commands/extensions.js +147 -149
  10. package/bin/lib/commands/extract-config.js +73 -67
  11. package/bin/lib/commands/index.js +12 -12
  12. package/bin/lib/commands/init.js +342 -240
  13. package/bin/lib/commands/publish.js +69 -75
  14. package/bin/lib/commands/socket.js +69 -69
  15. package/bin/lib/commands/ssl.js +14 -14
  16. package/bin/lib/constants.js +10 -24
  17. package/bin/lib/tui/App.tsx +761 -705
  18. package/bin/lib/tui/components/AIPanel.tsx +191 -171
  19. package/bin/lib/tui/components/CommandInput.tsx +394 -343
  20. package/bin/lib/tui/components/GeminiPanel.tsx +175 -151
  21. package/bin/lib/tui/components/Header.tsx +23 -21
  22. package/bin/lib/tui/components/LogPanel.tsx +244 -220
  23. package/bin/lib/tui/components/TabBar.tsx +50 -48
  24. package/bin/lib/tui/components/WelcomeScreen.tsx +126 -71
  25. package/bin/lib/tui/index.tsx +37 -39
  26. package/bin/lib/tui/services/AIService.ts +518 -462
  27. package/bin/lib/tui/services/ExtensionService.ts +140 -129
  28. package/bin/lib/tui/services/GeminiService.ts +367 -337
  29. package/bin/lib/tui/services/ServiceManager.ts +344 -322
  30. package/bin/lib/tui/services/SocketService.ts +168 -168
  31. package/bin/lib/tui/services/ViteService.ts +88 -88
  32. package/bin/lib/tui/services/index.ts +47 -22
  33. package/bin/lib/utils/ai-scaffold.js +291 -280
  34. package/bin/lib/utils/extract-config.js +157 -140
  35. package/bin/lib/utils/files.js +82 -86
  36. package/bin/lib/utils/index.js +7 -7
  37. package/bin/lib/utils/paths.js +34 -34
  38. package/bin/lib/utils/prompts.js +194 -169
  39. package/bin/lib/utils/ssl.js +79 -81
  40. package/browser-extensions/README.md +0 -1
  41. package/browser-extensions/chrome/background.js +244 -237
  42. package/browser-extensions/chrome/content.js +32 -29
  43. package/browser-extensions/chrome/devtools.html +7 -7
  44. package/browser-extensions/chrome/devtools.js +19 -19
  45. package/browser-extensions/chrome/inspector.js +802 -767
  46. package/browser-extensions/chrome/manifest.json +71 -63
  47. package/browser-extensions/chrome/panel.html +674 -636
  48. package/browser-extensions/chrome/panel.js +722 -712
  49. package/browser-extensions/chrome/popup.html +586 -543
  50. package/browser-extensions/chrome/popup.js +282 -244
  51. package/browser-extensions/chrome/rules.json +1 -1
  52. package/browser-extensions/chrome/test-chrome.html +216 -136
  53. package/browser-extensions/chrome/test-mixed-content.html +284 -189
  54. package/browser-extensions/chrome/test-uri-pattern.html +221 -198
  55. package/browser-extensions/firefox/README.md +9 -6
  56. package/browser-extensions/firefox/background.js +221 -218
  57. package/browser-extensions/firefox/content.js +55 -52
  58. package/browser-extensions/firefox/debug-errors.html +386 -228
  59. package/browser-extensions/firefox/debug-https.html +153 -105
  60. package/browser-extensions/firefox/devtools.html +7 -7
  61. package/browser-extensions/firefox/devtools.js +23 -20
  62. package/browser-extensions/firefox/inspector.js +802 -767
  63. package/browser-extensions/firefox/manifest.json +68 -68
  64. package/browser-extensions/firefox/panel.html +674 -636
  65. package/browser-extensions/firefox/panel.js +722 -712
  66. package/browser-extensions/firefox/popup.html +572 -535
  67. package/browser-extensions/firefox/popup.js +281 -236
  68. package/browser-extensions/firefox/test-gramercy.html +170 -125
  69. package/browser-extensions/firefox/test-imports.html +59 -55
  70. package/browser-extensions/firefox/test-masking.html +231 -140
  71. package/browser-extensions/firefox/test-uri-pattern.html +221 -198
  72. package/dist/tui/App.d.ts +1 -1
  73. package/dist/tui/App.d.ts.map +1 -1
  74. package/dist/tui/App.js +154 -150
  75. package/dist/tui/App.js.map +1 -1
  76. package/dist/tui/components/AIPanel.d.ts.map +1 -1
  77. package/dist/tui/components/AIPanel.js +42 -35
  78. package/dist/tui/components/AIPanel.js.map +1 -1
  79. package/dist/tui/components/CommandInput.d.ts +1 -1
  80. package/dist/tui/components/CommandInput.d.ts.map +1 -1
  81. package/dist/tui/components/CommandInput.js +92 -62
  82. package/dist/tui/components/CommandInput.js.map +1 -1
  83. package/dist/tui/components/GeminiPanel.d.ts.map +1 -1
  84. package/dist/tui/components/GeminiPanel.js +37 -30
  85. package/dist/tui/components/GeminiPanel.js.map +1 -1
  86. package/dist/tui/components/Header.d.ts.map +1 -1
  87. package/dist/tui/components/Header.js +1 -1
  88. package/dist/tui/components/Header.js.map +1 -1
  89. package/dist/tui/components/LogPanel.d.ts +1 -1
  90. package/dist/tui/components/LogPanel.d.ts.map +1 -1
  91. package/dist/tui/components/LogPanel.js +26 -24
  92. package/dist/tui/components/LogPanel.js.map +1 -1
  93. package/dist/tui/components/TabBar.d.ts +2 -2
  94. package/dist/tui/components/TabBar.d.ts.map +1 -1
  95. package/dist/tui/components/TabBar.js +11 -11
  96. package/dist/tui/components/TabBar.js.map +1 -1
  97. package/dist/tui/components/WelcomeScreen.d.ts.map +1 -1
  98. package/dist/tui/components/WelcomeScreen.js +6 -6
  99. package/dist/tui/components/WelcomeScreen.js.map +1 -1
  100. package/dist/tui/index.d.ts.map +1 -1
  101. package/dist/tui/index.js +8 -8
  102. package/dist/tui/index.js.map +1 -1
  103. package/dist/tui/services/AIService.d.ts +2 -2
  104. package/dist/tui/services/AIService.d.ts.map +1 -1
  105. package/dist/tui/services/AIService.js +165 -125
  106. package/dist/tui/services/AIService.js.map +1 -1
  107. package/dist/tui/services/ExtensionService.d.ts +1 -1
  108. package/dist/tui/services/ExtensionService.d.ts.map +1 -1
  109. package/dist/tui/services/ExtensionService.js +33 -26
  110. package/dist/tui/services/ExtensionService.js.map +1 -1
  111. package/dist/tui/services/GeminiService.d.ts +1 -1
  112. package/dist/tui/services/GeminiService.d.ts.map +1 -1
  113. package/dist/tui/services/GeminiService.js +87 -76
  114. package/dist/tui/services/GeminiService.js.map +1 -1
  115. package/dist/tui/services/ServiceManager.d.ts +3 -3
  116. package/dist/tui/services/ServiceManager.d.ts.map +1 -1
  117. package/dist/tui/services/ServiceManager.js +72 -58
  118. package/dist/tui/services/ServiceManager.js.map +1 -1
  119. package/dist/tui/services/SocketService.d.ts.map +1 -1
  120. package/dist/tui/services/SocketService.js +32 -32
  121. package/dist/tui/services/SocketService.js.map +1 -1
  122. package/dist/tui/services/ViteService.d.ts.map +1 -1
  123. package/dist/tui/services/ViteService.js +26 -28
  124. package/dist/tui/services/ViteService.js.map +1 -1
  125. package/dist/tui/services/index.d.ts +6 -6
  126. package/dist/tui/services/index.d.ts.map +1 -1
  127. package/dist/tui/services/index.js +6 -6
  128. package/dist/tui/services/index.js.map +1 -1
  129. package/mcp/gxp-api-server.js +83 -81
  130. package/package.json +109 -93
  131. package/runtime/PortalContainer.vue +258 -234
  132. package/runtime/dev-tools/DevToolsModal.vue +153 -155
  133. package/runtime/dev-tools/LayoutSwitcher.vue +144 -140
  134. package/runtime/dev-tools/MockDataEditor.vue +456 -433
  135. package/runtime/dev-tools/SocketSimulator.vue +379 -371
  136. package/runtime/dev-tools/StoreInspector.vue +517 -455
  137. package/runtime/dev-tools/index.js +5 -5
  138. package/runtime/fallback-layouts/PrivateLayout.vue +2 -2
  139. package/runtime/fallback-layouts/PublicLayout.vue +2 -2
  140. package/runtime/fallback-layouts/SystemLayout.vue +2 -2
  141. package/runtime/gxpStringsPlugin.js +159 -134
  142. package/runtime/index.html +17 -19
  143. package/runtime/main.js +24 -22
  144. package/runtime/mock-api/auth-middleware.js +15 -15
  145. package/runtime/mock-api/image-generator.js +46 -46
  146. package/runtime/mock-api/index.js +55 -55
  147. package/runtime/mock-api/response-generator.js +116 -105
  148. package/runtime/mock-api/route-generator.js +107 -84
  149. package/runtime/mock-api/socket-triggers.js +94 -93
  150. package/runtime/mock-api/spec-loader.js +79 -80
  151. package/runtime/package.json +3 -0
  152. package/runtime/server.js +68 -68
  153. package/runtime/stores/gxpPortalConfigStore.js +204 -186
  154. package/runtime/stores/index.js +2 -2
  155. package/runtime/vite-inspector-plugin.js +858 -707
  156. package/runtime/vite-source-tracker-plugin.js +132 -113
  157. package/runtime/vite.config.js +207 -132
  158. package/scripts/launch-chrome.js +41 -41
  159. package/scripts/pack-chrome.js +38 -39
  160. package/socket-events/AiSessionMessageCreated.json +17 -17
  161. package/socket-events/SocialStreamPostCreated.json +23 -23
  162. package/socket-events/SocialStreamPostVariantCompleted.json +22 -22
  163. package/template/.claude/agents/gxp-developer.md +100 -99
  164. package/template/.claude/settings.json +7 -7
  165. package/template/AGENTS.md +30 -23
  166. package/template/GEMINI.md +20 -20
  167. package/template/README.md +70 -53
  168. package/template/app-manifest.json +2 -4
  169. package/template/configuration.json +10 -10
  170. package/template/default-styling.css +1 -1
  171. package/template/index.html +18 -20
  172. package/template/main.js +24 -22
  173. package/template/src/DemoPage.vue +415 -362
  174. package/template/src/Plugin.vue +76 -85
  175. package/template/src/stores/index.js +3 -3
  176. package/template/src/stores/test-data.json +164 -172
  177. package/template/theme-layouts/AdditionalStyling.css +50 -50
  178. package/template/theme-layouts/PrivateLayout.vue +8 -12
  179. package/template/theme-layouts/PublicLayout.vue +8 -12
  180. package/template/theme-layouts/SystemLayout.vue +8 -12
  181. package/template/vite.extend.js +45 -0
  182. package/template/vite.config.js +0 -409
@@ -1,126 +1,171 @@
1
- <!DOCTYPE html>
1
+ <!doctype html>
2
2
  <html>
3
- <head>
4
- <title>Test Gramercy.cloud Regex Pattern</title>
5
- <style>
6
- body { font-family: Arial, sans-serif; padding: 20px; max-width: 800px; }
7
- .test-section { margin: 20px 0; padding: 20px; border: 2px solid #ddd; border-radius: 8px; }
8
- .success { border-color: #28a745; background: #f8fff8; }
9
- .warning { border-color: #ffc107; background: #fffbf0; }
10
- .code { background: #e9ecef; padding: 8px; font-family: monospace; margin: 8px 0; word-break: break-all; }
11
- .results { background: #f5f5f5; padding: 10px; margin: 10px 0; border-radius: 4px; }
12
- button { padding: 10px 15px; margin: 5px; cursor: pointer; background: #007bff; color: white; border: none; border-radius: 4px; }
13
- </style>
14
- </head>
15
- <body>
16
- <h1>Gramercy.cloud Regex Test</h1>
17
-
18
- <div class="test-section success">
19
- <h2>✅ Your Regex Pattern</h2>
20
- <div class="code">([a-zA-Z0-9-]+\.)gramercy\.cloud\/uploads</div>
21
- <p><strong>Target URL:</strong></p>
22
- <div class="code">https://hilton-pop-art-cytz-dani-martin-hueg.gramercy.cloud/uploads/assets/5233/file_name/nU01Ln1738011172.png?URLPrefix=...</div>
23
- </div>
24
-
25
- <div class="test-section">
26
- <h2>🧪 Regex Testing</h2>
27
- <button onclick="testRegex()">Test Regex Match</button>
28
- <button onclick="testActualRequest()">Test Actual XHR Request</button>
29
- <div id="testResults" class="results"></div>
30
- </div>
31
-
32
- <div class="test-section warning">
33
- <h2>⚙️ Extension Setup Required</h2>
34
- <ol>
35
- <li>Open the Traffic Proxy extension popup</li>
36
- <li>Add a new rule:</li>
37
- <ul>
38
- <li><strong>Pattern:</strong> <code>([a-zA-Z0-9-]+\.)gramercy\.cloud\/uploads</code></li>
39
- <li><strong>Redirect To:</strong> <code>your-proxy-server.com</code></li>
40
- </ul>
41
- <li>Enable the proxy (green button)</li>
42
- <li>Click "Test Actual XHR Request" below</li>
43
- </ol>
44
- </div>
45
-
46
- <script>
47
- function log(message) {
48
- const results = document.getElementById('testResults');
49
- const timestamp = new Date().toLocaleTimeString();
50
- results.innerHTML += `<div>${timestamp}: ${message}</div>`;
51
- }
52
-
53
- function testRegex() {
54
- const results = document.getElementById('testResults');
55
- results.innerHTML = '';
56
-
57
- const pattern = /([a-zA-Z0-9-]+\.)gramercy\.cloud\/uploads/i;
58
- const testUrls = [
59
- 'https://hilton-pop-art-cytz-dani-martin-hueg.gramercy.cloud/uploads/assets/5233/file_name/nU01Ln1738011172.png',
60
- 'hilton-pop-art-cytz-dani-martin-hueg.gramercy.cloud', // hostname only
61
- 'hilton-pop-art-cytz-dani-martin-hueg.gramercy.cloud/uploads', // hostname + path
62
- 'other-subdomain.gramercy.cloud/uploads/test.jpg',
63
- 'gramercy.cloud/uploads', // should NOT match (no subdomain)
64
- 'hilton-pop-art-cytz-dani-martin-hueg.gramercy.cloud/downloads' // should NOT match (wrong path)
65
- ];
66
-
67
- log('🧪 Testing regex pattern against various URLs:');
68
-
69
- testUrls.forEach(url => {
70
- const matches = pattern.test(url);
71
- const icon = matches ? '✅' : '❌';
72
- log(`${icon} ${url} - ${matches ? 'MATCHES' : 'NO MATCH'}`);
73
- });
74
-
75
- log('');
76
- log('📝 Summary: Your regex will match URLs with:');
77
- log(' • Any subdomain of gramercy.cloud');
78
- log(' • Path starting with /uploads');
79
- log(' • Case insensitive matching');
80
- }
81
-
82
- async function testActualRequest() {
83
- const results = document.getElementById('testResults');
84
- results.innerHTML = '';
85
-
86
- log('🌐 Testing actual XHR request to gramercy.cloud...');
87
-
88
- // The exact URL from your example
89
- const testUrl = 'https://hilton-pop-art-cytz-dani-martin-hueg.gramercy.cloud/uploads/assets/5233/file_name/nU01Ln1738011172.png?URLPrefix=aHR0cHM6Ly9oaWx0b24tcG9wLWFydC1jeXR6LWRhbmktbWFydGluLWh1ZWcuZ3JhbWVyY3kuY2xvdWQvdXBsb2Fkcy9hc3NldHMvNTIzMy9maWxlX25hbWU=&Expires=1749745178&KeyName=uploads-backend-key&Signature=s1rfbFVLZWNdagigcQxbRacOa4k=';
90
-
91
- try {
92
- log('📡 Making XHR request...');
93
-
94
- const xhr = new XMLHttpRequest();
95
- xhr.onload = function() {
96
- log(`✅ XHR Success: ${xhr.status} ${xhr.statusText}`);
97
- log(`📏 Response size: ${xhr.responseText.length} bytes`);
98
- log('🔍 Check browser Network tab to see if request was intercepted');
99
- log('🔔 You should see a proxy notification if extension is working');
100
- };
101
-
102
- xhr.onerror = function() {
103
- log('❌ XHR failed - this might be expected if proxy redirected');
104
- log('🔍 Check browser Network tab to see actual destination');
105
- };
106
-
107
- xhr.ontimeout = function() {
108
- log('⏰ XHR timed out');
109
- };
110
-
111
- xhr.open('GET', testUrl);
112
- xhr.timeout = 10000; // 10 second timeout
113
- xhr.send();
114
-
115
- } catch (error) {
116
- log(`❌ Error making request: ${error.message}`);
117
- }
118
- }
119
-
120
- // Auto-run regex test on page load
121
- window.addEventListener('load', function() {
122
- testRegex();
123
- });
124
- </script>
125
- </body>
126
- </html>
3
+ <head>
4
+ <title>Test Gramercy.cloud Regex Pattern</title>
5
+ <style>
6
+ body {
7
+ font-family: Arial, sans-serif;
8
+ padding: 20px;
9
+ max-width: 800px;
10
+ }
11
+ .test-section {
12
+ margin: 20px 0;
13
+ padding: 20px;
14
+ border: 2px solid #ddd;
15
+ border-radius: 8px;
16
+ }
17
+ .success {
18
+ border-color: #28a745;
19
+ background: #f8fff8;
20
+ }
21
+ .warning {
22
+ border-color: #ffc107;
23
+ background: #fffbf0;
24
+ }
25
+ .code {
26
+ background: #e9ecef;
27
+ padding: 8px;
28
+ font-family: monospace;
29
+ margin: 8px 0;
30
+ word-break: break-all;
31
+ }
32
+ .results {
33
+ background: #f5f5f5;
34
+ padding: 10px;
35
+ margin: 10px 0;
36
+ border-radius: 4px;
37
+ }
38
+ button {
39
+ padding: 10px 15px;
40
+ margin: 5px;
41
+ cursor: pointer;
42
+ background: #007bff;
43
+ color: white;
44
+ border: none;
45
+ border-radius: 4px;
46
+ }
47
+ </style>
48
+ </head>
49
+ <body>
50
+ <h1>Gramercy.cloud Regex Test</h1>
51
+
52
+ <div class="test-section success">
53
+ <h2>✅ Your Regex Pattern</h2>
54
+ <div class="code">([a-zA-Z0-9-]+\.)gramercy\.cloud\/uploads</div>
55
+ <p><strong>Target URL:</strong></p>
56
+ <div class="code">
57
+ https://hilton-pop-art-cytz-dani-martin-hueg.gramercy.cloud/uploads/assets/5233/file_name/nU01Ln1738011172.png?URLPrefix=...
58
+ </div>
59
+ </div>
60
+
61
+ <div class="test-section">
62
+ <h2>🧪 Regex Testing</h2>
63
+ <button onclick="testRegex()">Test Regex Match</button>
64
+ <button onclick="testActualRequest()">Test Actual XHR Request</button>
65
+ <div id="testResults" class="results"></div>
66
+ </div>
67
+
68
+ <div class="test-section warning">
69
+ <h2>⚙️ Extension Setup Required</h2>
70
+ <ol>
71
+ <li>Open the Traffic Proxy extension popup</li>
72
+ <li>Add a new rule:</li>
73
+ <ul>
74
+ <li>
75
+ <strong>Pattern:</strong>
76
+ <code>([a-zA-Z0-9-]+\.)gramercy\.cloud\/uploads</code>
77
+ </li>
78
+ <li>
79
+ <strong>Redirect To:</strong> <code>your-proxy-server.com</code>
80
+ </li>
81
+ </ul>
82
+ <li>Enable the proxy (green button)</li>
83
+ <li>Click "Test Actual XHR Request" below</li>
84
+ </ol>
85
+ </div>
86
+
87
+ <script>
88
+ function log(message) {
89
+ const results = document.getElementById("testResults")
90
+ const timestamp = new Date().toLocaleTimeString()
91
+ results.innerHTML += `<div>${timestamp}: ${message}</div>`
92
+ }
93
+
94
+ function testRegex() {
95
+ const results = document.getElementById("testResults")
96
+ results.innerHTML = ""
97
+
98
+ const pattern = /([a-zA-Z0-9-]+\.)gramercy\.cloud\/uploads/i
99
+ const testUrls = [
100
+ "https://hilton-pop-art-cytz-dani-martin-hueg.gramercy.cloud/uploads/assets/5233/file_name/nU01Ln1738011172.png",
101
+ "hilton-pop-art-cytz-dani-martin-hueg.gramercy.cloud", // hostname only
102
+ "hilton-pop-art-cytz-dani-martin-hueg.gramercy.cloud/uploads", // hostname + path
103
+ "other-subdomain.gramercy.cloud/uploads/test.jpg",
104
+ "gramercy.cloud/uploads", // should NOT match (no subdomain)
105
+ "hilton-pop-art-cytz-dani-martin-hueg.gramercy.cloud/downloads", // should NOT match (wrong path)
106
+ ]
107
+
108
+ log("🧪 Testing regex pattern against various URLs:")
109
+
110
+ testUrls.forEach((url) => {
111
+ const matches = pattern.test(url)
112
+ const icon = matches ? "✅" : "❌"
113
+ log(`${icon} ${url} - ${matches ? "MATCHES" : "NO MATCH"}`)
114
+ })
115
+
116
+ log("")
117
+ log("📝 Summary: Your regex will match URLs with:")
118
+ log(" • Any subdomain of gramercy.cloud")
119
+ log(" • Path starting with /uploads")
120
+ log(" • Case insensitive matching")
121
+ }
122
+
123
+ async function testActualRequest() {
124
+ const results = document.getElementById("testResults")
125
+ results.innerHTML = ""
126
+
127
+ log("🌐 Testing actual XHR request to gramercy.cloud...")
128
+
129
+ // The exact URL from your example
130
+ const testUrl =
131
+ "https://hilton-pop-art-cytz-dani-martin-hueg.gramercy.cloud/uploads/assets/5233/file_name/nU01Ln1738011172.png?URLPrefix=aHR0cHM6Ly9oaWx0b24tcG9wLWFydC1jeXR6LWRhbmktbWFydGluLWh1ZWcuZ3JhbWVyY3kuY2xvdWQvdXBsb2Fkcy9hc3NldHMvNTIzMy9maWxlX25hbWU=&Expires=1749745178&KeyName=uploads-backend-key&Signature=s1rfbFVLZWNdagigcQxbRacOa4k="
132
+
133
+ try {
134
+ log("📡 Making XHR request...")
135
+
136
+ const xhr = new XMLHttpRequest()
137
+ xhr.onload = function () {
138
+ log(`✅ XHR Success: ${xhr.status} ${xhr.statusText}`)
139
+ log(`📏 Response size: ${xhr.responseText.length} bytes`)
140
+ log(
141
+ "🔍 Check browser Network tab to see if request was intercepted",
142
+ )
143
+ log(
144
+ "🔔 You should see a proxy notification if extension is working",
145
+ )
146
+ }
147
+
148
+ xhr.onerror = function () {
149
+ log("❌ XHR failed - this might be expected if proxy redirected")
150
+ log("🔍 Check browser Network tab to see actual destination")
151
+ }
152
+
153
+ xhr.ontimeout = function () {
154
+ log("⏰ XHR timed out")
155
+ }
156
+
157
+ xhr.open("GET", testUrl)
158
+ xhr.timeout = 10000 // 10 second timeout
159
+ xhr.send()
160
+ } catch (error) {
161
+ log(`❌ Error making request: ${error.message}`)
162
+ }
163
+ }
164
+
165
+ // Auto-run regex test on page load
166
+ window.addEventListener("load", function () {
167
+ testRegex()
168
+ })
169
+ </script>
170
+ </body>
171
+ </html>
@@ -1,58 +1,62 @@
1
- <!DOCTYPE html>
1
+ <!doctype html>
2
2
  <html>
3
- <head>
4
- <title>Test JavaScript Imports Interception</title>
5
- </head>
6
- <body>
7
- <h1>JavaScript Import Interception Test</h1>
8
- <p>Check the Network tab and proxy notifications to see if imports are intercepted.</p>
9
-
10
- <div id="results"></div>
11
-
12
- <script type="module">
13
- const results = document.getElementById('results');
14
-
15
- function log(message) {
16
- const div = document.createElement('div');
17
- div.textContent = `${new Date().toLocaleTimeString()}: ${message}`;
18
- results.appendChild(div);
19
- }
20
-
21
- // Test 1: Dynamic import
22
- log('Testing dynamic import...');
23
- try {
24
- const module = await import('https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js');
25
- log('✅ Dynamic import successful');
26
- } catch (error) {
27
- log('❌ Dynamic import failed: ' + error.message);
28
- }
29
-
30
- // Test 2: Fetch (for comparison)
31
- log('Testing fetch...');
32
- try {
33
- const response = await fetch('https://api.github.com/users/octocat');
34
- log('✅ Fetch successful');
35
- } catch (error) {
36
- log('❌ Fetch failed: ' + error.message);
37
- }
38
-
39
- // Test 3: Worker (if supported)
40
- log('Testing Web Worker...');
41
- try {
42
- const workerCode = `
3
+ <head>
4
+ <title>Test JavaScript Imports Interception</title>
5
+ </head>
6
+ <body>
7
+ <h1>JavaScript Import Interception Test</h1>
8
+ <p>
9
+ Check the Network tab and proxy notifications to see if imports are
10
+ intercepted.
11
+ </p>
12
+
13
+ <div id="results"></div>
14
+
15
+ <script type="module">
16
+ const results = document.getElementById("results")
17
+
18
+ function log(message) {
19
+ const div = document.createElement("div")
20
+ div.textContent = `${new Date().toLocaleTimeString()}: ${message}`
21
+ results.appendChild(div)
22
+ }
23
+
24
+ // Test 1: Dynamic import
25
+ log("Testing dynamic import...")
26
+ try {
27
+ const module =
28
+ await import("https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js")
29
+ log("✅ Dynamic import successful")
30
+ } catch (error) {
31
+ log("❌ Dynamic import failed: " + error.message)
32
+ }
33
+
34
+ // Test 2: Fetch (for comparison)
35
+ log("Testing fetch...")
36
+ try {
37
+ const response = await fetch("https://api.github.com/users/octocat")
38
+ log("✅ Fetch successful")
39
+ } catch (error) {
40
+ log("❌ Fetch failed: " + error.message)
41
+ }
42
+
43
+ // Test 3: Worker (if supported)
44
+ log("Testing Web Worker...")
45
+ try {
46
+ const workerCode = `
43
47
  self.postMessage('Worker loaded successfully');
44
48
  self.close();
45
- `;
46
- const blob = new Blob([workerCode], { type: 'application/javascript' });
47
- const worker = new Worker(URL.createObjectURL(blob));
48
- worker.onmessage = () => log('✅ Web Worker successful');
49
- worker.onerror = () => log('❌ Web Worker failed');
50
- } catch (error) {
51
- log('❌ Web Worker failed: ' + error.message);
52
- }
53
- </script>
54
-
55
- <!-- Test 4: Static import (commented out as it needs a real module file) -->
56
- <!-- <script type="module" src="https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js"></script> -->
57
- </body>
58
- </html>
49
+ `
50
+ const blob = new Blob([workerCode], { type: "application/javascript" })
51
+ const worker = new Worker(URL.createObjectURL(blob))
52
+ worker.onmessage = () => log("✅ Web Worker successful")
53
+ worker.onerror = () => log("❌ Web Worker failed")
54
+ } catch (error) {
55
+ log("❌ Web Worker failed: " + error.message)
56
+ }
57
+ </script>
58
+
59
+ <!-- Test 4: Static import (commented out as it needs a real module file) -->
60
+ <!-- <script type="module" src="https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js"></script> -->
61
+ </body>
62
+ </html>