# LeafWeb Browser 🍃

**LeafWeb** is a lightweight, high-performance web browser built with **C** and **WebKit2GTK**. It aims to provide a fast, customizable, and privacy-focused browsing experience with a modern UI and essential built-in features.

![License](https://img.shields.io/badge/license-MIT-blue.svg)
![Language](https://img.shields.io/badge/language-C-orange.svg)
![Toolkit](https://img.shields.io/badge/toolkit-GTK3-green.svg)

---

## ✨ Features

LeafWeb comes packed with features designed for power users and minimalists alike:

- 🎨 **Modern & Customizable UI**: Clean interface with tabbed browsing, dynamic themes (including **Dracula** 🧛), and smooth animations.
- 🛡️ **Privacy First**: Built-in **AdBlocker** and **SponsorBlock** integration to keep your browsing clean and uninterrupted.
- 🌙 **Dark Mode Everywhere**: Integrated **Dark Reader** support to force dark mode on all websites.
- ⏬ **Download Manager**: Native download manager with progress tracking, pause/resume capabilities, and file management.
- ⚙️ **Power User Settings**:
    - **Flags System** (`leaf://flags`): Tweak WebKit settings and experimental features.
    - **Keyboard Shortcuts**: Efficient navigation with custom bindings (Zoom, Tabs, etc.).
- 🚀 **Performance**: Native C implementation ensures minimal resource usage and startup time.

## 🛠️ Installation & Build

### Prerequisites

To build LeafWeb, you need a C compiler and the following development libraries installed on your system:

- **GTK+ 3.0**
- **WebKit2GTK 4.1**
- **SQLite3**
- **libcurl**
- **JSON-GLib 1.0**
- **CMake** & **Make** (for build system)

#### Debian/Ubuntu
```bash
sudo apt install build-essential cmake libgtk-3-dev libwebkit2gtk-4.1-dev libsqlite3-dev libcurl4-openssl-dev libjson-glib-dev
```

#### Fedora
```bash
sudo dnf install cmake gcc-c++ gtk3-devel webkit2gtk4.1-devel sqlite-devel libcurl-devel json-glib-devel
```

#### Arch Linux
```bash
sudo pacman -S cmake base-devel gtk3 webkit2gtk sqlite curl json-glib
```

### Building the Project

1.  **Clone the repository**:
    ```bash
    git clone https://github.com/yourusername/Leaf-Web.git
    cd Leaf-Web
    ```

2.  **Generate build files**:
    ```bash
    cmake .
    ```

3.  **Compile**:
    ```bash
    make
    ```

4.  **Run**:
    ```bash
    ./LeafWeb
    ```

## 📖 Usage

- **Launch**: Run `./LeafWeb` from the terminal or create a desktop entry.
- **New Tab**: Click the `+` button or press `Ctrl+T`.
- **Settings**: Open the menu (hamburger icon) -> Settings to customize themes, search engine, and more.
- **Flags**: Navigate to `leaf://flags` to access experimental features.
- **AdBlock**: Enabled by default to block intrusive ads.

## ⚠️ Known Issues / Drawbacks

While LeafWeb is functional, it is currently in **active development**:

- **Extension Support**: Currently hardcoded (AdBlock, DarkReader, SponsorBlock). No support for Chrome/Firefox WebExtensions yet.
- **Process Model**: Heavy sites might impact UI responsiveness depending on the WebKit process model.
- **Platform Support**: Primarily designed and tested on **Linux (X11/Wayland)**. Windows/macOS support is currently experimental or non-existent.

## 🗺️ Roadmap & Future Development

We have big plans for LeafWeb! Here is what we are working on:

- [ ] **WebExtensions API**: Support for installing standard `.crx` / `.xpi` extensions.
- [ ] **Sync**: Encrypted cloud sync for bookmarks, history, and passwords.
- [ ] **Tab Groups**: Organize tabs into collapsible groups for better productivity.
- [ ] **Advanced AdBlock**: Cosmetic filtering and custom filter list subscription support.
- [x] **Hardware Acceleration**: Improved video playback (VP9/AV1) and smooth scrolling.

## 🤝 Contributing

Contributions are welcome! Whether it's fixing bugs, improving docs, or adding features:

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

## 📄 License

This project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.

---
*Built with ❤️ by [Hasan Imroz] ⒸKonoha-Lab*
