Skip to content

Hrpav/hrBrowser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hrBrowser

A minimal web browser built with C++ and WebKitGTK

Features

  • Desktop window using GTK3
  • Embedded browser using WebKitGTK
  • Address bar with navigation
    • Enter any URL (e.g., google.com)
    • Search terms automatically search via Google
    • Auto-adds https:// if missing

Quick Start (Ubuntu)

1. Clone the repository

git clone https://github.com/Hrpavi/hrBrowser.git
cd hrBrowser

2. Install dependencies

sudo apt-get update
sudo apt-get install -y \
    build-essential \
    cmake \
    pkg-config \
    libgtk-3-dev \
    libwebkit2gtk-4.1-dev

3. Build

mkdir -p build
cd build
cmake ..
make -j4

4. Run

./hrBrowser

Usage

  1. Enter a URL (e.g., google.com, github.com, wikipedia.org) in the address bar
  2. Press Enter to navigate
  3. To quit, close the window or press Ctrl+C in the terminal

Address Bar Features

  • URL without protocol: Auto-adds https://
  • Plain text (no dots): Treated as Google search
  • Full URLs: Navigates directly

Project Structure

hrBrowser/
├── AGENTS.md
├── CMakeLists.txt
├── CODEX_SESSION.txt
├── LICENSE.txt
├── OPENCODE_SESSION.txt
├── README.md
├── browser
│   ├── browser.cpp
│   └── browser.h
├── src
│   └── main.cpp   
└── ui
    ├── address_bar
    │   ├── address_bar.cpp
    │   └── address_bar.h
    ├── backward_button
    │   ├── backward_button.cpp
    │   └── backward_button.h
    ├── forward_button
    │   ├── forward_button.cpp
    │   └── forward_button.h
    ├── refresh_button
    │   ├── refresh_button.cpp
    │   └── refresh_button.h
    ├── ui.cpp
    └── ui.

Requirements

System Packages (Ubuntu 22.04+)

sudo apt-get install build-essential cmake pkg-config libgtk-3-dev libwebkit2gtk-4.1-dev

For Older Ubuntu

# Ubuntu 20.04 (uses webkit2gtk-4.0)
sudo apt-get install libwebkit2gtk-4.0-dev

Building with CEF (Optional)

The original goal was using Chromium Embedded Framework (CEF), but the official binary downloads were corrupted. To use CEF properly:

  1. Download CEF from https://cef-builds.spotifycdn.com/index.html
  2. Extract to cef_binary/
  3. Copy generated headers to cef/include/

For more details, see CEF Documentation.

License

MIT License - See LICENSE.txt

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Note: This project uses WebKitGTK instead of CEF because the official CEF binary distributions were corrupted during download. WebKitGTK is also much simpler to integrate and has fewer dependencies.