Skip to content

Commit f0befdb

Browse files
Insert apertura stessa scheda
1 parent 8dc9010 commit f0befdb

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

index.html

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<body>
3737

3838
<div class="box">
39-
<h1>Test Agentforce</h1>
39+
<h1>Test Agentforce apertura link</h1>
4040

4141
<div class="form-row" style="background-color: #fafffa; border: 1px solid #cce5cc; padding: 10px; border-radius: 6px;">
4242
<label for="language-picker">Lingua Chat</label>
@@ -143,7 +143,24 @@ <h1>Test Agentforce</h1>
143143
}
144144
});
145145

146-
// 3. INIZIALIZZAZIONE EFFETTIVA
146+
// 3. GESTIONE CLICK LINK (Nuovo Event Listener)
147+
// Questo gestisce il reindirizzamento nella stessa tab per i link di upload
148+
window.addEventListener("onEmbeddedMessageLinkClicked", (event) => {
149+
// Recupera l'URL che l'utente ha appena cliccato
150+
const clickedUrl = event.detail.url;
151+
152+
console.log("Link cliccato nella chat:", clickedUrl);
153+
154+
// Controlla se l'URL è quello della tua pagina di upload
155+
if (clickedUrl.includes("uploadfile?caseId=")) {
156+
157+
console.log("Intercettato link di upload. Forzatura navigazione self.");
158+
// Forza l'apertura nella stessa scheda (tab)
159+
window.location.href = clickedUrl;
160+
}
161+
});
162+
163+
// 4. INIZIALIZZAZIONE EFFETTIVA
147164
embeddedservice_bootstrap.init(
148165
'00DUA000003hFV7',
149166
'ai_chogangroupspa_com',

0 commit comments

Comments
 (0)