Skip to content

feat: Session Binder — утилита для управления сессиями браузера (Playwright + CDP)#2

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1778521893-session-binder
Open

feat: Session Binder — утилита для управления сессиями браузера (Playwright + CDP)#2
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1778521893-session-binder

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented May 11, 2026

Summary

Добавлена утилита session_binder.py для управления сессиями браузера в локальной среде разработки.

Позволяет быстро переключаться между аккаунтами для тестирования:

  • Принимает файл с cookies в формате JSON
  • Подключается к локальному Chrome через CDP (Chrome DevTools Protocol, --remote-debugging-port)
  • Вставляет cookies в контекст браузера (context.add_cookies())
  • Переходит на указанный URL
  • Даёт разработчику настраиваемое время для ручной привязки сессии (email/телефон)
  • Автоматически закрывает браузер по таймеру или по Ctrl+C

Файлы

  • session_binder.py — основной скрипт (CLI: --cookies, --url, --wait, --port, -v)
  • requirements-session-binder.txt — зависимости (playwright>=1.40)
  • cookies_example.json — пример файла cookies
  • README_session_binder.md — документация на русском с примерами

Использование

pip install -r requirements-session-binder.txt
playwright install chromium
google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug &
python session_binder.py --cookies cookies.json --url https://example.com

Review & Testing Checklist for Human

  • Убедиться, что Chrome запущен с --remote-debugging-port=9222 перед запуском скрипта
  • Проверить вставку cookies на реальном сайте (подготовить JSON с валидными cookies)
  • Проверить, что сессия сохраняется после навигации на целевой URL

Notes

  • Утилита работает строго локально, подключаясь к Chrome на 127.0.0.1
  • Поддерживает как простой формат cookies ({name, value}), так и полный Playwright-формат с domain, path, httpOnly, secure, sameSite, expires

Link to Devin session: https://app.devin.ai/sessions/5a15505b721f42068f6fdbbedfdee60f
Requested by: @mingojce


Open in Devin Review

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant