Overview
The GenieHelper Cookie Capture browser extension enables seamless authentication with creator platforms by capturing and storing session cookies. This eliminates the need for repeatedly entering credentials and enables automated scraping and publishing workflows.Supported Platforms
The extension supports cookie capture for 9 creator platforms:- OnlyFans
- Fansly
- Pornhub
- XVideos
- TikTok
- X (Twitter)
- YouTube
How It Works
Cookie Capture Flow
- Navigate to Platform: Log in to any supported platform in your browser
- Open Extension: Click the GenieHelper extension icon
- Capture Cookies: The extension detects the current platform and captures all session cookies
- Secure Storage: Cookies are encrypted with AES-256-GCM and stored in the
platform_sessionscollection - Agent Reuse: Stagehand browser sessions can now inject these cookies to bypass login
Extension Components
Manifest (MV3)
The extension uses Manifest V3 with the following permissions:cookies: Read platform session cookiesactiveTab: Detect current platform from active tabstorage: Store configuration (server URL, Directus token, creator profile ID)
Background Service Worker
Location:/home/daytona/workspace/source/extension/background.js:1
Handles two message types:
CAPTURE_COOKIES: Collects cookies for detected platform and POSTs to/api/credentials/store-platform-sessionGET_CURRENT_TAB: Returns current tab URL and detected platform
Popup Interface
Location:/home/daytona/workspace/source/extension/popup.js:1
Provides:
- Platform Detection Indicator: Shows detected platform with colored dot
- Capture Button: Triggers cookie capture (disabled if not configured)
- Settings Link: Opens options page for configuration
- Status Messages: Real-time feedback during capture process
Configuration
Extension Options
The extension requires three configuration values stored inchrome.storage.sync:
| Field | Description |
|---|---|
serverUrl | Your GenieHelper server URL (e.g., https://geniehelper.com) |
directusToken | Directus authentication token for API access |
creatorProfileId | The ID of the creator_profiles record to associate cookies with |
First-Time Setup
- Install the extension from Chrome Web Store or Firefox Add-ons
- Right-click extension icon → Options
- Enter your server URL, Directus token, and creator profile ID
- Navigate to a supported platform and log in
- Click extension icon → “Capture Cookies”
HITL (Human-in-the-Loop) Sessions
What is HITL?
HITL sessions are triggered when automated scraping fails due to missing or expired cookies. Instead of failing silently, Genie Helper creates a HITL session request that alerts you to log in manually.HITL Flow
- Scrape Attempt: User clicks “Scrape Profile” in dashboard
- Cookie Check: System checks
platform_sessionsfor valid cookies - HITL Trigger: If no valid session exists, creates
hitl_sessionsrecord - Dashboard Alert: Yellow banner appears: “Login Required: [Platform]”
- User Action: User clicks banner → opens platform in new tab → logs in → captures cookies via extension
- Session Update:
hitl_sessions.statuschanges frompending→completed - Auto-Retry: Original scrape job automatically resumes with fresh cookies
HITL Sessions Collection
Collection:hitl_sessions
| Field | Type | Description |
|---|---|---|
id | UUID | Session identifier |
creator_profile_id | M2O | Link to creator profile |
platform | String | Platform requiring login (e.g., “onlyfans”) |
status | String | pending, completed, expired, failed |
requested_at | Timestamp | When HITL was triggered |
completed_at | Timestamp | When user completed login |
notes | Text | Error details or user notes |
Dashboard Integration
The dashboard polls for pending HITL sessions: Dashboard Banner Logic:Cookie Storage & Security
Platform Sessions Collection
Collection:platform_sessions
| Field | Type | Description |
|---|---|---|
id | UUID | Session identifier |
creator_profile_id | M2O | Creator profile this session belongs to |
platform | String | Platform name (e.g., “onlyfans”) |
cookies | JSON | Encrypted cookie array |
user_agent | String | Browser user agent (for Stagehand reuse) |
captured_at | Timestamp | When cookies were captured |
expires_at | Timestamp | Estimated expiration (90 days default) |
last_used_at | Timestamp | Last time cookies were injected into Stagehand |
Encryption
All cookies are encrypted server-side using AES-256-GCM before storage. Encryption Location:/home/daytona/workspace/source/server/utils/credentialsCrypto.js:1
Envelope Format:
CREDENTIALS_ENC_KEY_B64: Base64-encoded 32-byte encryption keyCREDENTIALS_ENC_AAD: Optional additional authenticated data (default: “agentx-v1”)
Cookie Normalization
Before encryption, cookies are normalized to remove Chrome-internal fields: Extension Normalization (background.js:94):
Stagehand Cookie Injection
Once captured, cookies are injected into Stagehand browser sessions for automated workflows.Injection Flow
- Fetch Session: Retrieve latest
platform_sessionsrecord for platform - Decrypt Cookies: Call
decryptJSON(session.cookies) - Start Stagehand: Initialize browser session via Stagehand MCP
- Inject Cookies: Call
set-cookiestool with decrypted cookie array - Navigate: Load platform URL with authenticated session
- Extract Data: Scrape profile stats, posts, earnings, etc.
stepExecutors.js:222):
Extension Development
File Structure
Building for Distribution
Chrome Web Store:- Zip entire
extension/directory (exclude.firefox.json) - Upload to Chrome Developer Dashboard
- Submit privacy policy (required for
cookiespermission)
- Rename
manifest.firefox.json→manifest.json - Zip directory
- Upload to Firefox Add-on Developer Hub
Privacy Policy
The extension must include a privacy policy due to cookie permissions: Key Points:- Cookies are only captured on user action (button click)
- Cookies are sent only to user’s configured GenieHelper server
- No third-party tracking or analytics
- All data encrypted server-side with AES-256-GCM
Troubleshooting
”Not Configured” Error
If extension shows “Not Configured” banner:- Open extension options (right-click icon → Options)
- Verify server URL includes
https://and no trailing slash - Confirm Directus token is valid (test in dashboard)
- Ensure creator profile ID exists in
creator_profilescollection
”No Cookies Found” Error
If capture fails with no cookies:- Confirm you’re logged into the platform
- Check platform is in supported list
- Clear browser cookies and re-login
- Try capturing immediately after login
”Server Error 401” Error
If API returns 401 Unauthorized:- Directus token may be expired or invalid
- Regenerate token in Directus admin panel
- Update extension options with new token
HITL Session Stuck in “Pending”
If HITL session doesn’t complete:- Manually update
hitl_sessionsstatus tocompletedin Directus - Verify
platform_sessionsrecord was created - Check
captured_attimestamp is recent - Re-trigger scrape job from dashboard
Related Documentation
- Platform Connections - Managing creator platform credentials
- Stagehand Automation - Browser automation workflows
- Directus CMS - Collections and data model
