[PR #153] [CLOSED] Add electron API to open external URLs. #647

Closed
opened 2026-10-31 22:15:35 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/desktop/pull/153
Author: @robinjhuang
Created: 10/30/2024
Status: ❌ Closed

Base: main ← Head: rh-url


📝 Commits (1)

  • 396668f Add electron API to open external URLs.

📊 Changes

3 files changed (+11 additions, -0 deletions)

View changed files

📝 src/constants.ts (+1 -0)
📝 src/main.ts (+6 -0)
📝 src/preload.ts (+4 -0)

📄 Description

Resolves #138

ComfyUI_frontend needs to add something like :

document.addEventListener('click', (event) => {
    const target = event.target as HTMLElement;
    const anchor = target.closest('a');
    
    if (anchor && anchor.href && anchor.href.startsWith('http')) {
      event.preventDefault();
      electronAPI.openExternal(anchor.href);
    }
  });

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/desktop/pull/153 **Author:** [@robinjhuang](https://github.com/robinjhuang) **Created:** 10/30/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `rh-url` --- ### 📝 Commits (1) - [`396668f`](https://github.com/Comfy-Org/desktop/commit/396668f2bbf0a9c89ee74a627065ff516f19697f) Add electron API to open external URLs. ### 📊 Changes **3 files changed** (+11 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/constants.ts` (+1 -0) 📝 `src/main.ts` (+6 -0) 📝 `src/preload.ts` (+4 -0) </details> ### 📄 Description Resolves #138 `ComfyUI_frontend` needs to add something like : ``` document.addEventListener('click', (event) => { const target = event.target as HTMLElement; const anchor = target.closest('a'); if (anchor && anchor.href && anchor.href.startsWith('http')) { event.preventDefault(); electronAPI.openExternal(anchor.href); } }); ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 22:15:35 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/desktop#647
No description provided.