@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,190 +1,285 @@
|
|
|
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
|
-
|
|
3
|
+
<head>
|
|
4
|
+
<title>Mixed Content Proxy Test</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
|
+
.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
|
+
.status-indicator {
|
|
58
|
+
display: inline-block;
|
|
59
|
+
width: 12px;
|
|
60
|
+
height: 12px;
|
|
61
|
+
border-radius: 50%;
|
|
62
|
+
margin-right: 8px;
|
|
63
|
+
}
|
|
64
|
+
.blocked {
|
|
65
|
+
background: #dc3545;
|
|
66
|
+
}
|
|
67
|
+
.allowed {
|
|
68
|
+
background: #28a745;
|
|
69
|
+
}
|
|
70
|
+
.warning-icon {
|
|
71
|
+
background: #ffc107;
|
|
72
|
+
}
|
|
73
|
+
</style>
|
|
74
|
+
</head>
|
|
75
|
+
<body>
|
|
76
|
+
<h1>🔒 Mixed Content Proxy Test</h1>
|
|
77
|
+
|
|
78
|
+
<div class="test-section info">
|
|
79
|
+
<h2>🌐 Current Page Security</h2>
|
|
80
|
+
<div id="pageInfo"></div>
|
|
81
|
+
<div class="code" id="currentUrl"></div>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<div class="test-section warning">
|
|
85
|
+
<h2>⚠️ Mixed Content Policy</h2>
|
|
86
|
+
<p>
|
|
87
|
+
<strong>Browser Security Rule:</strong> HTTPS pages cannot make requests
|
|
88
|
+
to HTTP endpoints
|
|
89
|
+
</p>
|
|
90
|
+
<ul>
|
|
91
|
+
<li>
|
|
92
|
+
<span class="status-indicator blocked"></span
|
|
93
|
+
><strong>BLOCKED:</strong> HTTPS → HTTP (Subresources)
|
|
94
|
+
</li>
|
|
95
|
+
<li>
|
|
96
|
+
<span class="status-indicator warning-icon"></span
|
|
97
|
+
><strong>WARNING:</strong> HTTPS → HTTP (Navigation)
|
|
98
|
+
</li>
|
|
99
|
+
<li>
|
|
100
|
+
<span class="status-indicator allowed"></span
|
|
101
|
+
><strong>ALLOWED:</strong> HTTPS → HTTPS
|
|
102
|
+
</li>
|
|
103
|
+
<li>
|
|
104
|
+
<span class="status-indicator allowed"></span
|
|
105
|
+
><strong>ALLOWED:</strong> HTTP → HTTP
|
|
106
|
+
</li>
|
|
107
|
+
</ul>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<div class="test-section">
|
|
111
|
+
<h2>🧪 Mixed Content Tests</h2>
|
|
112
|
+
<button onclick="testHttpsToHttp()">Test HTTPS → HTTP Fetch</button>
|
|
113
|
+
<button onclick="testHttpsToHttps()">Test HTTPS → HTTPS Fetch</button>
|
|
114
|
+
<button onclick="testImageLoad()">Test HTTP Image Load</button>
|
|
115
|
+
<button onclick="testScriptLoad()">Test HTTP Script Load</button>
|
|
116
|
+
<div id="testResults" class="results"></div>
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
<div class="test-section error">
|
|
120
|
+
<h2>❌ Common Scenarios That Fail</h2>
|
|
121
|
+
<div class="code">
|
|
122
|
+
# Page: https://example.com<br />
|
|
123
|
+
# Proxy rule: api.service.com → http://my-proxy.local:8080<br />
|
|
124
|
+
# Result: ❌ BLOCKED - Mixed content violation
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
<div class="test-section success">
|
|
129
|
+
<h2>✅ Working Solutions</h2>
|
|
130
|
+
<h3>Option 1: Use HTTPS for Proxy Target</h3>
|
|
131
|
+
<div class="code">
|
|
132
|
+
# Proxy rule: api.service.com → https://my-proxy.com<br />
|
|
133
|
+
# Result: ✅ WORKS - Both HTTPS
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
<h3>Option 2: Setup HTTPS on Local Proxy</h3>
|
|
137
|
+
<div class="code">
|
|
138
|
+
# Use mkcert or similar to create local HTTPS<br />
|
|
139
|
+
# Proxy rule: api.service.com → https://localhost:8443<br />
|
|
140
|
+
# Result: ✅ WORKS - HTTPS to HTTPS
|
|
141
|
+
</div>
|
|
142
|
+
|
|
143
|
+
<h3>Option 3: Browser Flags (Development Only)</h3>
|
|
144
|
+
<div class="code">
|
|
145
|
+
# Chrome: --disable-web-security
|
|
146
|
+
--disable-features=VizDisplayCompositor<br />
|
|
147
|
+
# Firefox: security.mixed_content.block_active_content = false<br />
|
|
148
|
+
# Result: ⚠️ WORKS but INSECURE
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
<div class="test-section info">
|
|
153
|
+
<h2>🔧 Extension Capabilities</h2>
|
|
154
|
+
<table style="width: 100%; border-collapse: collapse">
|
|
155
|
+
<tr style="background: #f8f9fa">
|
|
156
|
+
<th style="border: 1px solid #ddd; padding: 8px">Request Type</th>
|
|
157
|
+
<th style="border: 1px solid #ddd; padding: 8px">HTTPS → HTTP</th>
|
|
158
|
+
<th style="border: 1px solid #ddd; padding: 8px">
|
|
159
|
+
Extension Override
|
|
160
|
+
</th>
|
|
161
|
+
</tr>
|
|
162
|
+
<tr>
|
|
163
|
+
<td style="border: 1px solid #ddd; padding: 8px">
|
|
164
|
+
Main Frame Navigation
|
|
165
|
+
</td>
|
|
166
|
+
<td style="border: 1px solid #ddd; padding: 8px">⚠️ Warning shown</td>
|
|
167
|
+
<td style="border: 1px solid #ddd; padding: 8px">✅ Can redirect</td>
|
|
168
|
+
</tr>
|
|
169
|
+
<tr>
|
|
170
|
+
<td style="border: 1px solid #ddd; padding: 8px">fetch() / XHR</td>
|
|
171
|
+
<td style="border: 1px solid #ddd; padding: 8px">❌ Blocked</td>
|
|
172
|
+
<td style="border: 1px solid #ddd; padding: 8px">❌ Still blocked</td>
|
|
173
|
+
</tr>
|
|
174
|
+
<tr>
|
|
175
|
+
<td style="border: 1px solid #ddd; padding: 8px">Images / CSS</td>
|
|
176
|
+
<td style="border: 1px solid #ddd; padding: 8px">❌ Blocked</td>
|
|
177
|
+
<td style="border: 1px solid #ddd; padding: 8px">❌ Still blocked</td>
|
|
178
|
+
</tr>
|
|
179
|
+
<tr>
|
|
180
|
+
<td style="border: 1px solid #ddd; padding: 8px">
|
|
181
|
+
Scripts / Modules
|
|
182
|
+
</td>
|
|
183
|
+
<td style="border: 1px solid #ddd; padding: 8px">❌ Blocked</td>
|
|
184
|
+
<td style="border: 1px solid #ddd; padding: 8px">❌ Still blocked</td>
|
|
185
|
+
</tr>
|
|
186
|
+
</table>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
<script>
|
|
190
|
+
function log(message, type = "info") {
|
|
191
|
+
const results = document.getElementById("testResults")
|
|
192
|
+
const timestamp = new Date().toLocaleTimeString()
|
|
193
|
+
const icon =
|
|
194
|
+
type === "error"
|
|
195
|
+
? "❌"
|
|
196
|
+
: type === "success"
|
|
197
|
+
? "✅"
|
|
198
|
+
: type === "warning"
|
|
199
|
+
? "⚠️"
|
|
200
|
+
: "ℹ️"
|
|
201
|
+
results.innerHTML += `<div>${timestamp} ${icon} ${message}</div>`
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function updatePageInfo() {
|
|
205
|
+
const protocol = window.location.protocol
|
|
206
|
+
const isHttps = protocol === "https:"
|
|
207
|
+
const pageInfo = document.getElementById("pageInfo")
|
|
208
|
+
const currentUrl = document.getElementById("currentUrl")
|
|
209
|
+
|
|
210
|
+
pageInfo.innerHTML = `
|
|
211
|
+
<strong>Protocol:</strong> ${protocol} ${isHttps ? "🔒 Secure" : "🔓 Insecure"}<br>
|
|
212
|
+
<strong>Mixed Content Policy:</strong> ${isHttps ? "✅ Active" : "➖ Not applicable"}
|
|
213
|
+
`
|
|
214
|
+
currentUrl.textContent = window.location.href
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
async function testHttpsToHttp() {
|
|
218
|
+
log("Testing HTTPS page → HTTP endpoint...")
|
|
219
|
+
|
|
220
|
+
try {
|
|
221
|
+
const response = await fetch(
|
|
222
|
+
"http://httpbin.org/get?test=mixed-content",
|
|
223
|
+
)
|
|
224
|
+
log(`✅ Request succeeded: ${response.status}`, "success")
|
|
225
|
+
} catch (error) {
|
|
226
|
+
if (error.message.includes("mixed content")) {
|
|
227
|
+
log(`❌ Mixed content blocked: ${error.message}`, "error")
|
|
228
|
+
} else {
|
|
229
|
+
log(`❌ Request failed: ${error.message}`, "error")
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
async function testHttpsToHttps() {
|
|
235
|
+
log("Testing HTTPS page → HTTPS endpoint...")
|
|
236
|
+
|
|
237
|
+
try {
|
|
238
|
+
const response = await fetch("https://httpbin.org/get?test=secure")
|
|
239
|
+
log(`✅ Request succeeded: ${response.status}`, "success")
|
|
240
|
+
} catch (error) {
|
|
241
|
+
log(`❌ Request failed: ${error.message}`, "error")
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function testImageLoad() {
|
|
246
|
+
log("Testing HTTP image load...")
|
|
247
|
+
|
|
248
|
+
const img = new Image()
|
|
249
|
+
img.onload = () => log("✅ HTTP image loaded successfully", "success")
|
|
250
|
+
img.onerror = () =>
|
|
251
|
+
log("❌ HTTP image blocked by mixed content policy", "error")
|
|
252
|
+
img.src = "http://httpbin.org/image/png?test=image"
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function testScriptLoad() {
|
|
256
|
+
log("Testing HTTP script load...")
|
|
257
|
+
|
|
258
|
+
const script = document.createElement("script")
|
|
259
|
+
script.onload = () =>
|
|
260
|
+
log("✅ HTTP script loaded successfully", "success")
|
|
261
|
+
script.onerror = () =>
|
|
262
|
+
log("❌ HTTP script blocked by mixed content policy", "error")
|
|
263
|
+
script.src =
|
|
264
|
+
"http://httpbin.org/base64/Y29uc29sZS5sb2coJ0hUVFAgc2NyaXB0IGxvYWRlZCcpOw=="
|
|
265
|
+
document.head.appendChild(script)
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Initialize page
|
|
269
|
+
updatePageInfo()
|
|
270
|
+
|
|
271
|
+
// Show initial warning if on HTTPS
|
|
272
|
+
if (window.location.protocol === "https:") {
|
|
273
|
+
log(
|
|
274
|
+
"⚠️ This is an HTTPS page. HTTP requests will be blocked by mixed content policy.",
|
|
275
|
+
"warning",
|
|
276
|
+
)
|
|
277
|
+
} else {
|
|
278
|
+
log(
|
|
279
|
+
"ℹ️ This is an HTTP page. No mixed content restrictions apply.",
|
|
280
|
+
"info",
|
|
281
|
+
)
|
|
282
|
+
}
|
|
283
|
+
</script>
|
|
284
|
+
</body>
|
|
285
|
+
</html>
|