mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
fix(ui): prevent tabnabbing in chat images (#18685)
* UI: prevent tabnabbing in chat images * ui: remove comment from image open helper --------- Co-authored-by: Shakker <shakkerdroid@gmail.com>
This commit is contained in:
committed by
GitHub
parent
66e61ca6ce
commit
649d141527
@@ -200,6 +200,13 @@ function renderMessageImages(images: ImageBlock[]) {
|
||||
return nothing;
|
||||
}
|
||||
|
||||
const openImage = (url: string) => {
|
||||
const opened = window.open(url, "_blank", "noopener,noreferrer");
|
||||
if (opened) {
|
||||
opened.opener = null;
|
||||
}
|
||||
};
|
||||
|
||||
return html`
|
||||
<div class="chat-message-images">
|
||||
${images.map(
|
||||
@@ -208,7 +215,7 @@ function renderMessageImages(images: ImageBlock[]) {
|
||||
src=${img.url}
|
||||
alt=${img.alt ?? "Attached image"}
|
||||
class="chat-message-image"
|
||||
@click=${() => window.open(img.url, "_blank")}
|
||||
@click=${() => openImage(img.url)}
|
||||
/>
|
||||
`,
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user