Skip to content

Fix WebUI URLs showing about:blank#blocked when folder is collapsed#29

Open
JimboLodisC wants to merge 1 commit intoVladoPortos:mainfrom
JimboLodisC:webui-url-fix
Open

Fix WebUI URLs showing about:blank#blocked when folder is collapsed#29
JimboLodisC wants to merge 1 commit intoVladoPortos:mainfrom
JimboLodisC:webui-url-fix

Conversation

@JimboLodisC
Copy link
Copy Markdown

Summary

  • Fixes the longstanding bug where clicking the WebUI globe icon (or the WebUI menu option in Advanced preview context) opens about:blank#blocked instead of the container's web interface
  • Root cause: DockerUtil::host() can return empty, causing [IP] token in WebUI URLs to be replaced with nothing, producing malformed URLs like http://:8080
  • Adds a PHP-side fallback using $_SERVER['HTTP_HOST'] when DockerUtil::host() fails, and a JS-side safety net that detects and fixes broken URLs using window.location.hostname

Test plan

  • Create a folder with "Preview Context" set to "Advanced"
  • Collapse the folder and click the WebUI globe icon on a running container — should open the correct http://IP:PORT URL instead of about:blank#blocked
  • Verify the WebUI menu option inside the Advanced tooltip popup also works
  • Verify Tailscale WebUI links also work if applicable
  • Verify "Default" preview context still works as before

Fixes #8, fixes #17, fixes #9.

🤖 Generated with Claude Code

DockerUtil::host() can return empty, causing [IP] token in WebUI URLs
to be replaced with nothing (e.g., http://:8080). Browsers block this
malformed URL as about:blank#blocked.

PHP fix: use empty() instead of !isset() to catch empty string, and
fall back to $_SERVER['HTTP_HOST'] when DockerUtil::host() fails.

JS fix: safety net that detects broken http://:PORT URLs in parsed
container info and injects window.location.hostname.

Fixes VladoPortos#8, fixes VladoPortos#17, fixes VladoPortos#9.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant