feat: cookies button in sidebar footer opens cookie picker

One-click cookie import from the sidebar. Navigates the headed browser
to /cookie-picker where you can select which domains to import from
your real Chrome profile.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-04-04 07:50:59 -07:00
parent 6921e1cf63
commit c430798788
2 changed files with 16 additions and 0 deletions
+1
View File
@@ -156,6 +156,7 @@
<button class="debug-toggle" id="debug-toggle" title="Toggle debug panels">debug</button>
<button class="footer-btn" id="clear-chat" title="Clear chat">clear</button>
<button class="footer-btn" id="reload-sidebar" title="Reload sidebar">reload</button>
<button class="footer-btn" id="copy-cookies" title="Import cookies from your browser">cookies</button>
</div>
<div class="footer-right">
<span class="dot" id="footer-dot"></span>
+15
View File
@@ -636,6 +636,21 @@ document.getElementById('reload-sidebar').addEventListener('click', () => {
location.reload();
});
// ─── Copy Cookies ───────────────────────────────────────────────
document.getElementById('copy-cookies').addEventListener('click', async () => {
if (!serverUrl) return;
// Navigate the browser to the cookie picker page hosted by the browse server
try {
await fetch(`${serverUrl}/command`, {
method: 'POST',
headers: authHeaders(),
body: JSON.stringify({ command: 'goto', args: [`${serverUrl}/cookie-picker`] }),
});
} catch (err) {
console.error('[gstack sidebar] Failed to open cookie picker:', err.message);
}
});
// ─── Debug Tabs ─────────────────────────────────────────────────
const debugToggle = document.getElementById('debug-toggle');