You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
adk web: Links in chat responses should open in a new tab #4580
When the agent responds with a URL in adk web, clicking it navigates away
from the chat — the user loses their conversation. Links rendered in chat
messages should open in a new browser tab.
Steps to reproduce
adk web --reload_agents
Ask the agent a question that produces a response containing a URL
Click the link in the rendered chat message
The browser navigates away from the ADK web UI — the conversation is lost
Expected behavior
External links (http://… / https://…) in chat responses should open in a
new tab (target="_blank") with rel="noopener noreferrer".
Suggested fix
In the Angular web UI component that renders chat messages, add target="_blank" and rel="noopener noreferrer" to auto-linked URLs.
For example, if links are rendered via Angular's markdown/HTML binding, a
directive or pipe could post-process <a> elements:
// Wherever chat message HTML is rendered:// Add target="_blank" rel="noopener noreferrer" to external <a> tagsWorkaroundWe're currently injecting a MutationObserver script into
google/adk/cli/browser/index.htmlpost-installthatpatcheslinksastheyappearintheDOM.Thisworksbuthastobere-appliedaftereverypipinstall.Environment-adk-pythonversion: latest(pip)-Browser: Chrome/Safari/Firefox(allaffected)-OS: macOS/Linux
@Vidon212 The root cause is in the marked.js link() renderer bundled at google/adk/cli/browser/main-*.js — it builds <a href="URL"> with no target or rel, so every click navigates in the same tab.
Until this lands in adk-web, patch the installed bundle by finding the string let o='<a href="'+t+'"' in that file and replacing it with let o='<a href="'+t+'" target="_blank" rel="noopener noreferrer"' — a backup copy first is recommended since you'll need to redo this after upgrades.
The proper fix belongs in the adk-web Angular markdown component.
@Vidon212 The root cause is in the marked.js link() renderer bundled at google/adk/cli/browser/main-*.js — it builds <a href="URL"> with no target or rel, so every click navigates in the same tab.
Until this lands in adk-web, patch the installed bundle by finding the string let o='<a href="'+t+'"' in that file and replacing it with let o='<a href="'+t+'" target="_blank" rel="noopener noreferrer"' — a backup copy first is recommended since you'll need to redo this after upgrades.
The proper fix belongs in the adk-web Angular markdown component.
so this is issue is solved, have you fixed the angular componenet?
The actual fix (adding target="_blank" rel="noopener noreferrer" to the link renderer) needs to go into the adk-web
repository's Angular markdown component — not adk-python.
Feel free to open a PR ; the bundle workaround I described confirms exactly where the change needs to happen.
I’ve opened a fix in the adk-web Angular Markdown component: google/adk-web#541
HTTP/HTTPS links now open in a new tab with rel="noopener noreferrer", including links added during streaming. Relative, fragment, and email links retain their existing behavior.
Added regression tests; locally, 781 tests pass and the production build succeeds. The PR is ready for review. Feedback is welcome!
Activity
Sravan1011 commentedon Feb 22, 2026
@Vidon212 Sir can you assign this task to me
surajksharma07 commentedon Feb 22, 2026
@Vidon212 The root cause is in the marked.js
link()renderer bundled atgoogle/adk/cli/browser/main-*.js— it builds<a href="URL">with notargetorrel, so every click navigates in the same tab.Until this lands in adk-web, patch the installed bundle by finding the string
let o='<a href="'+t+'"'in that file and replacing it withlet o='<a href="'+t+'" target="_blank" rel="noopener noreferrer"'— a backup copy first is recommended since you'll need to redo this after upgrades.The proper fix belongs in the adk-web Angular markdown component.
Sravan1011 commentedon Feb 23, 2026
so this is issue is solved, have you fixed the angular componenet?
surajksharma07 commentedon Feb 23, 2026
@Sravan1011 The Angular component hasn't been updated yet — the bundle patch is the working workaround for now and it does resolve the UX problem.
surajksharma07 commentedon Feb 23, 2026
@seanzhou1023 Please have a look into it.
Sravan1011 commentedon Feb 23, 2026
So shall we take up the angular problem or the maintainers are going to work on that patch ?
surajksharma07 commentedon Feb 23, 2026
@Sravan1011 If you want to contribute the fix, feel free to open a PR.
Sravan1011 commentedon Feb 23, 2026
hey have you submitted any pr ? if not can you assign me the issue
surajksharma07 commentedon Feb 25, 2026
@wyf7107 PTAL.
surajksharma07 commentedon Feb 25, 2026
@Sravan1011 No PR has been submitted yet.
The actual fix (adding
target="_blank" rel="noopener noreferrer"to the link renderer) needs to go into the adk-webrepository's Angular markdown component — not adk-python.
Feel free to open a PR ; the bundle workaround I described confirms exactly where the change needs to happen.
Team is looking more into it.
Vidon212 commentedon Oct 4, 2026
I’ve opened a fix in the adk-web Angular Markdown component: google/adk-web#541
HTTP/HTTPS links now open in a new tab with rel="noopener noreferrer", including links added during streaming. Relative, fragment, and email links retain their existing behavior.
Added regression tests; locally, 781 tests pass and the production build succeeds. The PR is ready for review. Feedback is welcome!