mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-02 11:45:20 +02:00
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:
@@ -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>
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user