sparkecode-devtools 0.1.43 → 0.1.44
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/package.json +1 -1
- package/sparkecode-select.js +8 -0
package/package.json
CHANGED
package/sparkecode-select.js
CHANGED
|
@@ -1160,6 +1160,7 @@
|
|
|
1160
1160
|
|
|
1161
1161
|
const iframe = document.getElementById('sparkecode-webframe-iframe');
|
|
1162
1162
|
const loading = document.getElementById('sparkecode-webframe-loading');
|
|
1163
|
+
if (!webFrame || !iframe) return;
|
|
1163
1164
|
|
|
1164
1165
|
// Build embed URL with session ID
|
|
1165
1166
|
let url = getWebUiUrl();
|
|
@@ -1168,6 +1169,13 @@
|
|
|
1168
1169
|
} else {
|
|
1169
1170
|
url += '/embed';
|
|
1170
1171
|
}
|
|
1172
|
+
|
|
1173
|
+
// Pass API base via query param so embed can reach the server
|
|
1174
|
+
const apiUrl = config.sparkecoder?.apiBase || sparkecoderState.apiBase;
|
|
1175
|
+
if (apiUrl) {
|
|
1176
|
+
const joiner = url.includes('?') ? '&' : '?';
|
|
1177
|
+
url += `${joiner}apiUrl=${encodeURIComponent(apiUrl)}`;
|
|
1178
|
+
}
|
|
1171
1179
|
|
|
1172
1180
|
if (iframe && iframe.src !== url) {
|
|
1173
1181
|
if (loading) loading.style.display = 'flex';
|