added sidebar contextual information for firefox (#5433)
Signed-off-by: 40u5 <meswag74@gmail.com>
This commit is contained in:
@@ -474,8 +474,7 @@ async function loadSessionIfExists() {
|
||||
resumeDiv.className = 'message system-message';
|
||||
resumeDiv.innerHTML = `<em>Session resumed: ${sessionData.messages.length} messages loaded</em>`;
|
||||
messagesContainer.appendChild(resumeDiv);
|
||||
|
||||
|
||||
|
||||
// Update page title with session description if available
|
||||
if (sessionData.metadata && sessionData.metadata.description) {
|
||||
document.title = `goose chat - ${sessionData.metadata.description}`;
|
||||
@@ -510,6 +509,24 @@ messageInput.addEventListener('input', () => {
|
||||
// Initialize WebSocket connection
|
||||
connectWebSocket();
|
||||
|
||||
// Read 'q' parameter from URL and set it to the message input
|
||||
function getQueryParam() {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const queryParam = urlParams.get('q');
|
||||
if (queryParam) {
|
||||
messageInput.value = queryParam;
|
||||
urlParams.delete('q');
|
||||
|
||||
let newUrl = window.location.pathname;
|
||||
if (urlParams.toString()) {
|
||||
newUrl = `${window.location.pathname}?${urlParams.toString()}`;
|
||||
}
|
||||
window.history.replaceState({}, '', newUrl);
|
||||
}
|
||||
}
|
||||
|
||||
getQueryParam();
|
||||
|
||||
// Focus on input
|
||||
messageInput.focus();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user