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 -5Ignore whitespace
public/scripts/extensions/stable-diffusion/index.js+15 -1
@@ -1571,7 +1571,7 @@ function renderRunpodStatus(status) {
15711571 const showLink = phase === 'green' && status?.url;
15721572 openLink.style.display = showLink ? '' : 'none';
15731573 if (showLink) {
15741574 openLink.hrefdataset.url = status.url;
15751575 }
15761576 }
15771577 if (!status) {
@@ -7344,6 +7344,20 @@ export async function init() {
73447344 $('#sd_runpod_lazy_url').on('input', onRunpodLazyUrlInput);
73457345 $('#sd_runpod_warmup').on('click', () => runpodControl('warmup'));
73467346 $('#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+ });
73477361 $('#sd_runpod_models_add').on('click', onRunpodModelsAddClick);
73487362 $('#sd_custom_entry_add').on('click', onAddCustomEntryClick);
73497363 $('#sd_custom_entries_list').on('click', '[data-action]', function () {
public/scripts/extensions/stable-diffusion/settings.html+4 -4
@@ -95,10 +95,10 @@
9595 <i class="fa-solid fa-power-off"></i>
9696 <span data-i18n="Shut down">Shut down</span>
9797 </div>
9898 <adiv id="sd_runpod_open" class="menu_button menu_button_icon" href="#" target="_blank" rel="noopener" title="OpenCopy the pod's ComfyUI webURL interface(RunPod blocks clicked cross-site links; paste it into a new tab)" data-i18n="[title]sd_runpod_open" style="display: none;">
9999 <i class="fa-solid fa-up-right-from-squarecopy"></i>
100100 <span data-i18n="OpenCopy ComfyUI URL">OpenCopy ComfyUI URL</span>
101101 </adiv>
102102 </div>
103103 <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>
104104 <h5 data-i18n="Model catalog">Model catalog</h5>