How to Open Websites Inside Flowork and Login with Cookies

🌐 Browser Automation javascript v2 Updated

Complete guide for opening websites as native BrowserView tabs inside the Flowork OS window and logging in via cookie injection. Covers the workspace/cookies/ folder system, the exact tool workflow (list_workspace → read_workspace_file → open_browser_tab → import_cookies → capture_browser), and how Electron session.cookies.set() works at engine level.

How to Open Websites Inside Flowork and Login with Cookies

Overview

The Flowork AI can open any website directly inside the Flowork OS main window as a native tab. This is done using open_browser_tab, which creates an Electron BrowserView inside the main window. The user sees the website directly in Flowork — no external popups or separate windows.

The Cookie Login Workflow

Step 1: Check workspace for cookie files
  → list_workspace { "folder": "cookies" }
  → Finds: tiktok.txt, twitter.txt, etc.

Step 2: Read the cookie file → read_workspace_file { "path": "cookies/tiktok.txt" } → Returns Netscape format content

Step 3: Open website inside Flowork → open_browser_tab { "url": "https://www.tiktok.com" } → Creates BrowserView tab in main window

Step 4: Import cookies (wait 2-3s for page load) → import_cookies { "tabId": "...", "netscape": "..." } → Uses Electron session.cookies.set() (engine-level) → Page auto-reloads

Step 5: Verify login → capture_browser → check for profile icon

Workspace Folder Structure

The File Manager panel (left side) shows the workspace/ directory with auto-created sub-folders:
  • cookies/ — Netscape format .txt cookie files
  • video/ — Video files for upload
  • musik/ — Audio files
  • media/ — Mixed media
  • images/ — Image files

Why Electron session.cookies.set()?

Unlike document.cookie (which only works for the current domain and can't set HttpOnly cookies), Electron's session.cookies.set() works at the browser engine level:
  • Can set cookies for ANY domain
  • Can set HttpOnly and Secure cookies
  • Persists across page reloads (session-partitioned)
  • Works with all cookie attributes (expiry, SameSite, etc.)

API Reference

| Tool | Purpose | Key Parameters | |------|---------|---------------| | list_workspace | List files in workspace | folder: sub-folder name | | read_workspace_file | Read file content | path: relative or absolute path | | open_browser_tab | Open URL inside Flowork | url, label | | import_cookies | Import Netscape cookies | tabId, netscape or cookies | | capture_browser | Take screenshot | tabId | | navigate_browser | Navigate to new URL | tabId, url | | close_browser_tab | Close tab | tabId |

Version History

Version Date Changes
v2 2026-04-01 Added JavaScript document.cookie fallback pattern and fixed Netscape parser escaping bug