|
Browser extension for researching online behavior and user privacy
Features β’ Installation β’ Usage β’ API Documentation β’ Contributing β’ License
GESIS Surf is a scientific study conducted by GESIS β Leibniz Institute for the Social Sciences to understand how people browse the internet in Germany.
π Looking for the backend? Check out GESIS Surf Backend
- π Privacy-Conscious Data Collection - Ethical research on online browsing behavior
- π Secure Authentication - Built-in authentication service with secure token management
- π Cross-Browser Support - Works on both Firefox and Google Chrome
- π Real-time Monitoring - Track user interactions including clicks, scroll behavior, and DOM changes
- π‘οΈ Privacy Mode - Optional privacy controls with configurable timers
- πΎ IndexedDB Storage - Efficient client-side data management
- β‘ Hot Module Replacement - Fast development workflow with HMR support
- Node.js: >= 18.12.0
- Package Manager: pnpm 9.1.1 or higher
Clone the repository and install dependencies:
git clone https://github.com/Fersonmx/Gesis-Surf.git
cd Gesis-Surf
npm install
# or
pnpm installBuild the extension for Firefox (default):
npm run buildThe compiled files will be in the dist/ directory.
To load the extension in Firefox:
- Navigate to
about:debugging#/runtime/this-firefox - Or go to Firefox > Preferences > Extensions & Themes > Debug Add-ons > Load Temporary Add-on...
- Locate and select the
dist/manifest.jsonfile
Build the extension for Google Chrome:
npm run build:chromeThe compiled files will be in the dist/ directory.
To load the extension in Chrome:
- Open
chrome://extensions/ - Enable Developer mode (top-right corner)
- Click Load unpacked
- Select the
dist/directory
For Chrome (with HMR support):
npm run devFor Firefox (with HMR support):
npm run dev:firefoxnpm run clean- Clean build artifacts and cachenpm run build- Build for Firefoxnpm run build:chrome- Build for Chromenpm run dev- Start development server (Chrome)npm run dev:firefox- Start development server (Firefox)npm run test- Run testsnpm run type-check- Type-check the entire projectnpm run lint- Lint all filesnpm run lint:fix- Fix linting issuesnpm run prettier- Format code with Prettiernpm run docs- Generate TypeDoc documentation
βββ chrome-extension/ # Chrome extension source code
β βββ lib/ # Core extension logic
β β βββ background/ # Service worker/background script
β β βββ events/ # Event managers and handlers
β β βββ handlers/ # Message and content handlers
β β βββ services/ # Authentication, data collection, sync
β β βββ db/ # Database service and configuration
β β βββ messages/ # Message handling
β βββ public/ # Static assets
β βββ manifest.js # Extension manifest
βββ pages/ # UI components and pages
β βββ popup/ # Extension popup interface
β β βββ src/components/ # React components (Login, PrivacyMode, etc.)
β βββ content/ # Content script for page interaction
βββ packages/ # Shared packages and utilities
β βββ shared/ # Shared React hooks, services, and utilities
β βββ hmr/ # Hot module replacement utilities
β βββ dev-utils/ # Development utilities
β βββ tsconfig/ # Shared TypeScript configurations
βββ docs/ # Generated TypeDoc documentation
- background.ts - Main service worker that manages extension lifecycle and events
- content-script - Injected script that collects page interaction data (clicks, scrolls, DOM changes)
- index.html - Popup UI for user authentication and settings
- AuthService - Handles authentication and token management
- DatabaseService - Manages IndexedDB for client-side data storage
- EventManager - Coordinates events from tabs, windows, and content scripts
- DataCollectionService - Processes and manages collected user interaction data
The extension follows a modular architecture:
- Background Script (Service Worker) - Manages extension state and coordinates events
- Content Script - Collects user interaction data from web pages
- Popup UI - Provides user authentication and privacy controls
- Message Passing - Secure communication between background, content, and popup scripts
- IndexedDB - Local storage for data persistence
βββββββββββββββββββββββ
β Browser Extension β
βββββββββββββββββββββββ€
β - Content Script β Collects: clicks, scrolls, DOM changes,
β - Background Worker β domains, tab/window events
β - Popup UI β
β - IndexedDB Storage β
ββββββββββββ¬βββββββββββ
β HTTPS/Secure
β Authentication
βΌ
βββββββββββββββββββββββ
β Django Backend β
βββββββββββββββββββββββ€
β - REST API β Processes: user registration,
β - Token Auth β authentication, data aggregation,
β - Database β analysis & reporting
β - Celery/Redis β
β - Elasticsearch β
βββββββββββββββββββββββ
Data Flow:
- Extension collects user interaction data locally
- Data is sent to backend API via secure HTTPS connection
- Backend processes and stores data in PostgreSQL
- Celery tasks handle async processing
- Elasticsearch indexes data for fast retrieval
- Research team analyzes aggregated, anonymized data
We welcome contributions! Please see our Contributing Guide for detailed information on:
- πΏ Branching Strategy -
devβmainβprodworkflow - π Commit Conventions - Using Commitizen with Conventional Commits
- π Code Quality - Pre-commit hooks, linting, and formatting
- π Pull Request Process - Guidelines and review workflow
- Fork the repository
- Create a feature branch from
devgit checkout dev && git pull origin dev git checkout -b feature/amazing-feature - Install pre-commit hooks
pnpm install pnpm run prepare
- Commit using Commitizen
git add . npm run cz commit - Push and open a Pull Request targeting
dev
This project uses:
- ESLint - For code linting
- Prettier - For code formatting
- TypeScript - For type safety
- Husky - For pre-commit hooks
- lint-staged - For running linters on staged files
Run quality checks:
npm run lint
npm run lint:fix
npm run type-check
npm run prettier- Frontend: React 18, React Router, Tailwind CSS
- Build Tools: Vite, Turbo (monorepo)
- Language: TypeScript
- Storage: IndexedDB
- Browser APIs: WebExtension API with polyfill support
- Development: Husky, lint-staged, Prettier
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright Β© 2023-2025 GESIS β Leibniz Institute for the Social Sciences
The GESIS Surf Extension works in conjunction with the GESIS Surf Backend for data processing and storage.
- GESIS Surf Backend - Django REST API for data collection, user management, and research analysis
- Built with Django 4.2 and Python 3.10+
- PostgreSQL for persistent storage
- Celery/Redis for async task processing
- Elasticsearch for fast data retrieval
- Docker-ready deployment
The extension communicates with the backend API for:
| Endpoint | Purpose |
|---|---|
/api/user/ |
User registration and profile management |
/api/user/token/ |
Authentication token generation |
/api/window/ |
Browser window tracking |
/api/tab/ |
Browser tab monitoring |
/api/domain/ |
Domain information and classification |
/api/clicks/ |
Click event submission |
/api/scrolls/ |
Scroll event submission |
/api/html/ |
DOM content and page structure data |
- Mario Ramirez - Lead Research Software Engineer - @geomario @MarioGesis
- Fernando Guzman - Software Architect Consultant - @Fernando
- Prof. Dr. Sebastian Stier - Department Director CSS @Seb
- Dr. Frank Mangold - Kommissarischer Teamleiter DDD @Frank
This extension is designed with privacy in mind. Data collection is:
- Transparent - Users know what data is being collected
- Ethical - Complies with research ethics standards
- Secure - Uses secure authentication and storage mechanisms
- User-Controlled - Includes privacy mode and user controls
For detailed privacy information, please refer to the project's privacy documentation or contact GESIS directly.
Questions or feedback? Reach out!
- GitHub Issues: Create an issue
- Backend Issues: Backend Repository
- GESIS: https://www.gesis.org/
If you use this software in your research, please cite:
@article{ramirez2025gesis,
title = {GESIS Surf Extension},
author = {Ramirez, Mario and },
journal = {SoftwareX},
volume = {XX},
pages = {XXXXXX},
year = {2026},
publisher = {Elsevier},
doi = {10.1016/j.softx.2025.xxxxxx}
}See CITATION.cff for more citation formats.
