@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.
- 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 +207 -132
- 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,126 +1,171 @@
|
|
|
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
|
-
|
|
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
|
-
<!
|
|
1
|
+
<!doctype html>
|
|
2
2
|
<html>
|
|
3
|
-
<head>
|
|
4
|
-
|
|
5
|
-
</head>
|
|
6
|
-
<body>
|
|
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
|
-
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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>
|