Stable Diffusion: RunPod ComfyUI link becomes a copy-URL button (RunPod WAF 403s cross-site link clicks)

2bf084a21ab15090a9e3ef671b60efe545ac9c70

permissionBRICK <40219477+permissionBRICK@users.noreply.github.com>

2 files changed, +19 -5Showing whitespace changes
public/scripts/extensions/stable-diffusion/index.js+15 -1
@@ -1571,7 +1571,7 @@ function renderRunpodStatus(status) {
1571 const showLink = phase === 'green' && status?.url;1571 const showLink = phase === 'green' && status?.url;
1572 openLink.style.display = showLink ? '' : 'none';1572 openLink.style.display = showLink ? '' : 'none';
1573 if (showLink) {1573 if (showLink) {
1574 openLink.href = status.url;1574 openLink.dataset.url = status.url;
1575 }1575 }
1576 }1576 }
1577 if (!status) {1577 if (!status) {
@@ -7344,6 +7344,20 @@ export async function init() {
7344 $('#sd_runpod_lazy_url').on('input', onRunpodLazyUrlInput);7344 $('#sd_runpod_lazy_url').on('input', onRunpodLazyUrlInput);
7345 $('#sd_runpod_warmup').on('click', () => runpodControl('warmup'));7345 $('#sd_runpod_warmup').on('click', () => runpodControl('warmup'));
7346 $('#sd_runpod_shutdown').on('click', () => runpodControl('shutdown'));7346 $('#sd_runpod_shutdown').on('click', () => runpodControl('shutdown'));
7347 // Copy instead of navigate: RunPod's WAF 403s any cross-site link click
7348 // (Sec-Fetch-Site: cross-site); only direct/pasted navigations pass.
7349 $('#sd_runpod_open').on('click', async function () {
7350 const url = this.dataset.url;
7351 if (!url) {
7352 return;
7353 }
7354 try {
7355 await navigator.clipboard.writeText(url);
7356 toastr.info(t`ComfyUI URL copied — paste it into a new browser tab.`, t`Image Generation`);
7357 } catch {
7358 window.prompt('Copy the ComfyUI URL:', url);
7359 }
7360 });
7347 $('#sd_runpod_models_add').on('click', onRunpodModelsAddClick);7361 $('#sd_runpod_models_add').on('click', onRunpodModelsAddClick);
7348 $('#sd_custom_entry_add').on('click', onAddCustomEntryClick);7362 $('#sd_custom_entry_add').on('click', onAddCustomEntryClick);
7349 $('#sd_custom_entries_list').on('click', '[data-action]', function () {7363 $('#sd_custom_entries_list').on('click', '[data-action]', function () {
public/scripts/extensions/stable-diffusion/settings.html+4 -4
@@ -95,10 +95,10 @@
95 <i class="fa-solid fa-power-off"></i>95 <i class="fa-solid fa-power-off"></i>
96 <span data-i18n="Shut down">Shut down</span>96 <span data-i18n="Shut down">Shut down</span>
97 </div>97 </div>
98 <a id="sd_runpod_open" class="menu_button menu_button_icon" href="#" target="_blank" rel="noopener" title="Open the pod's ComfyUI web interface" data-i18n="[title]sd_runpod_open" style="display: none;">98 <div id="sd_runpod_open" class="menu_button menu_button_icon" title="Copy the pod's ComfyUI URL (RunPod blocks clicked cross-site links; paste it into a new tab)" data-i18n="[title]sd_runpod_open" style="display: none;">
99 <i class="fa-solid fa-up-right-from-square"></i>99 <i class="fa-solid fa-copy"></i>
100 <span data-i18n="Open ComfyUI">Open ComfyUI</span>100 <span data-i18n="Copy ComfyUI URL">Copy ComfyUI URL</span>
101 </a>101 </div>
102 </div>102 </div>
103 <small data-i18n="sd_runpod_small">While a SillyTavern tab is open, a keepalive ping keeps the pod alive; it shuts down 15 minutes after the last activity either way. Red = off, orange = starting/downloading models, green = ready.</small>103 <small data-i18n="sd_runpod_small">While a SillyTavern tab is open, a keepalive ping keeps the pod alive; it shuts down 15 minutes after the last activity either way. Red = off, orange = starting/downloading models, green = ready.</small>
104 <h5 data-i18n="Model catalog">Model catalog</h5>104 <h5 data-i18n="Model catalog">Model catalog</h5>