diff --git a/AF_Enhanced_HTML_Note.py b/AF_Enhanced_HTML_Note.py index 5fad673..ec4d23d 100644 --- a/AF_Enhanced_HTML_Note.py +++ b/AF_Enhanced_HTML_Note.py @@ -6,7 +6,7 @@ # # LICENSE: MIT License # -# v0.0.05 +# v0.0.06 # # Description: # A ComfyUI Note node with html capabilities. Create notes, UI's and ReadMe's directly inside the workflow, using html. @@ -15,22 +15,12 @@ # Read Me on Github # # Changelog: -# v0.0.05 -# - Made edit mode less intrusive and keep ComfyUI canvas navigation (panning, zooming [space bar] and [H] now work to pan around the canvas) -# v0.0.04 -# - Fixed node selection and resizing by removing OUTPUT_NODE and using proper widget approach -# - Double clicking is now used to edit the html -# - Mouse interaction is now persistent to ComfyUI behavior. Except middle mouse button for panning. -# v0.0.03 -# - Fixed node resizing issues on save/reload -# - Improved selection and edit mode behavior to match ComfyUI core notes -# - Fixed middle mouse button panning over the node -# - Improved HTML indentation in default content -# v0.0.02 -# - Fixed naming consistency to HTML_Note -# - Implemented single-window toggle behavior -# v0.0.01 -# - Initial Version +# "v0.0.06 - Removed all Java Script functionality for links and updated README", +# "v0.0.05 - Made edit mode less intrusive and keep ComfyUI canvas navigation (panning, zooming [space bar] and [H] now work to pan around the canvas)", +# "v0.0.04 - Fixed node selection and resizing by removing OUTPUT_NODE and using proper widget approach. Double clicking is now used to edit the html Mouse interaction is now persistent to ComfyUI behavior. Except middle mouse button for panning.", +# "v0.0.03 - Fixed node resizing issues on save/reload. Improved selection and edit mode behavior to match ComfyUI core notes. Fixed middle mouse button panning over the node. Improved HTML indentation in default content", +# "v0.0.02 - Fixed naming consistency to HTML_Note Implemented single-window toggle behavior", +# "v0.0.01 - Initial Version" # class AF_Enhanced_HTML_Note: @@ -137,20 +127,12 @@ class AF_Enhanced_HTML_Note:

🔗 Interactive Links

- + +

External link (opens in new tab with Ctrl+click)

Full Frame Studios - Alex Furer

- -

Click for alert

- - -

Log to console

- - -

Link with logging

- - -

JavaScript alert link

+

Anchor Links

+

Full Frame Studios - Alex Furer - 3D

Custom Info Cards

diff --git a/README.md b/README.md index 1076273..e1392bb 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ A ComfyUI Note node with HTML capabilities. Create notes, UI's and ReadMe's dire - **Rich HTML Support** - Full HTML formatting with colored sections, lists, tables, code blocks, and more - **Non-Intrusive Design** - Doesn't interfere with normal ComfyUI workflow interactions - **Easy Editing** - Double-click anywhere on the content to edit HTML -- **Smart Links** - Ctrl+click to open external links or trigger custom actions +- **Smart Links** - Ctrl+click to open external links (JavaScript disabled for security) - **Beautiful Styling** - Predefined color schemes that match ComfyUI's theme - **Custom HTML Support** - Write your own HTML with inline styles - **No Dependencies** - All CSS is inlined for reliable performance @@ -30,7 +30,7 @@ A ComfyUI Note node with HTML capabilities. Create notes, UI's and ReadMe's dire ### Using Links - **Hold Control key + Click** on any link to activate it - External links open in new tabs -- JavaScript actions and alerts work when Control is held +- JavaScript execution is disabled for security ### Node Management - **Click and drag** the node title bar to move @@ -320,17 +320,14 @@ All links require **Ctrl+Click** to activate for safety and to prevent accidenta

ComfyUI GitHub Repository

- -

Click for alert

+ +

Jump to section

- -

Log to console

+ +

Send Email

- -

Link with logging

- - -

JavaScript alert link

+ +

Documentation

``` @@ -339,6 +336,17 @@ All links require **Ctrl+Click** to activate for safety and to prevent accidenta **Remember:** Hold **Ctrl** while clicking any link to activate it! +### Supported Link Types: +- ✅ **External URLs** (`https://`, `http://`) - Open in new tab +- ✅ **Anchor links** (`#section`) - Page navigation +- ✅ **Mailto links** (`mailto:`) - Open email client +- ✅ **Tel links** (`tel:`) - Open phone app +- ✅ **Relative URLs** - Open in new tab + +### Not Supported Link Types: +- ❌ **JavaScript links** (`javascript:`) - Blocked for security +- ❌ **onclick handlers** - Ignored for security + --- @@ -359,6 +367,52 @@ The node supports **standard HTML** with **inline CSS styling**. You can write c --- +## ⚠️ JavaScript Limitations + +JavaScript functionality is limited for security. It **only works on `` (link) elements** and **only when Ctrl+Click is used**. + +### ✅ What Works (with Ctrl+Click on links): +```html + +Alert on click + + +Log to console + + +Confirmation dialog + + +Multiple actions +``` + +### ❌ What Doesn't Work: +```html + +JavaScript link + + +Alert link + + + + + + +
Won't work
+``` + +### Security Restrictions: +- **No JavaScript execution** - All JavaScript is blocked for security +- **No ` - - - -
Won't work
- - -
Won't fire
-Won't fire - - - - Can't modify other elements - - - - - Storage APIs blocked - -``` - -### Security Restrictions: -- **No `