Git Product home page Git Product logo

hbro's Introduction

hbro

In a nutshell, hbro is a minimal web browser for linux. It is written, configured and extensible in Haskell.

Information about versions, dependencies, source repositories and contacts can be found in hackage.

Design principles

Do one thing well
A web browser is not a {window|bookmarks|history|download|passwords|package} manager, let alone an operating system. A web browser retrieves, renders and traverses web pages, period.
Keep It Simple, Stupid
The application should be written with simplicity in mind, and without obsession for performance, features or release frequency. It should boot instantly, consume little memory and offer an uncluttered graphical interface. The code should be easy to grasp (well, as long as you speak Haskell...) to encourage users to hack it. Simplicity provides lightness, scalability, stability and maintainability.
Extensible
Users should be able to implement extra features through an extension system, without digging into the internals of the application. External programs should be able to query/command the web browser.
Good defaults
The default behavior should be suitable for users that cannot afford or don't want to spend (waste ?) their time in tweaks.
Keyboard driven
Keyboard control should be made as much convenient, with as little mouse intervention, as possible.

Components and libraries used

Programming language : Haskell
Modern, purely-functional language that makes it possible to work with a concise, elegant and robust code.
Layout engine : WebKit
Has to be open-source, be (kind of) standards-compliant, and provide a Haskell binding. Considering those requirements, WebKit is pretty much the only game in town.
HTTP client : WebKit
Ideally, the HTTP client should be delegated to a distinct library (typically http-conduit), but WebKit clearly wasn't designed to be used as a mere layout engine. So for now, it still handles all network connections.
UI toolkit : GTK+
Given the programming language and layout engine, there's no much choice left for the UI toolkit.
Interprocess interface : ZeroMQ
Socket-like interface that implements various communication schemes like request-reply and publish-subscribe.
Configuration system : Dyre
Dynamic reconfiguration library for haskell programs.

Suggestions about better alternatives for any of these points (except the programming language) are welcome.

Installation notes

Up until GHC 7.8, hbro requires the integer-simple package, which means you won't be able to build it using a standard GHC installation that uses the integer-gmp package. This distinction is documented here, and the reason for this constraint is explained there.

Starting with GHC 7.10, the integer-gmp package was completely rewritten and integer-simple is no longer required.

Configuration

By default, a minimal configuration file (see Hbro/Main.hs) is used to build hbro. You can create your own at ~/.hbro/hbro.hs to override it. Several extensions are provided with the * hbro-contrib * package, including a commented configuration file example.

GUI layout

The graphical layout is described in an XML file that is parsed by GtkBuilder. This file is looked for in several places with the following order of priority:

  • the value from commandline option -U;
  • the ~/.hbro/ui.xml file;
  • the examples/ui.xml file bundled with the package.

At least the following widgets must be defined, with the adequate id attributes, for the browser to start:

Type id
GtkWindow mainWindow
GtkVBox windowBox
GtkScrolledWindow webViewParent
GtkHBox promptBox
GtkLabel promptDescription
GtkEntry promptEntry
GtkHBox statusBox
GtkLabel notificationLabel

Known bugs and limitations

Many problems/limitations are inherited from the Haskell bindings webkitgtk3 and gtk3. Until fixed in upstream, nothing can be done on hbro to work around them. Here's a summary of them:

  • segmentation faults when loading some webpages while javascript/flash is enabled;
  • vertical scrollbar cannot be hidden;
  • no proxy configuration;
  • no cookies management;
  • javascript's window.open requests open in the same window instead of spawning a new one;
  • toggling to source mode reloads current webpage (which may be undesired)

Patches or suggestions to deal with these issues are welcome.

License

hbro is distributed under the Do-What-The-Fuck-You-Want-To public licence, which has a pretty self-explanatory name.

hbro's People

Contributors

clinty avatar mdorman avatar meditans avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.