Git Product home page Git Product logo

gs-webbrowser's Introduction

WebBrowser

WebBrowser.app is based on Google Chrome and specifically created for GNUstep Desktop.

It uses XEmbedding + Chrome extension API to accomplish its goal. One huge advantage of this approach is that it uses Google's own binary, which means no compromises!

It will play Netflix or let you log into your Google account without complaining. Yet, you'll get full GNUstep experience.

  • GNUstep UI with proper menus
  • pasteboard integration
  • services
  • scripting using StepTalk

Prerequisites

WebBrowser.app relies on GS Desktop to work properly, using it as stand-alone application is probably not going to work.

As the app is just a wrapper, it obviously needs Chrome properly installed. This can be done differently depending on what version or flavour of your Linux distro you are running.

As long as the app can find one of the following binaries, you should be fine.

google-chrome
chromium
chromium-browser
chrome

Manual Install Chrome (x64)

do the following:

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb

Manual Install Chrome (Ubuntu)

do the following:

apt install chrome-browser

How does it work

WebBrowser.app relies on Chrome extension API and on Chrome's ability to load extensions as web-apps (--load-and-launch-app). This functionality might get removed from Chrome as it has been marked as deprecated, but so far so good.

event flow

ExternalWebView                  Chrome App                                      Web page
command --- socket --> background.js --- post message --> window.js --- API --> webview tag
event   <-- socket --- background.js <-- post message --- window.js <-- API --- webview tag

initialization

  1. ChromeController starts chrome process (Resources/webview/start.sh) Chrome tends to create background process that is reused, this makes it a bit messy. The script creates empty pid file and waits for it to contain port of the Chrome app.

  2. The start.sh uses --load-and-launch-app to load Chrome app declared in manifest.json.

  3. The Chrome app (background.js) starts local socket server. It writes its port into the pid file.

  4. ChromeController pickups the port number and connects to it. It delegates connection to the ExternalWebView

  5. ExternalWebView will connect to the background.js and starts conversation. New connection will create new Chrome Window (window.js). Once new Chrome Window appears, it is captured by ExternalWebView and reparented into its own view.

  6. ExternalWebView issues commands that will be passed to the window.js. Like load page and also listens for events coming back.

Future Direction

Although the browser is fully functional as of today, it still has many rough edges.

Improve how downloads are handled. As this functionality is not exposed by the Chrome extension API in any meaning way, I had to "hack" around it. I'll have to find a better way.

Drag & Drop support - this is mainly limited by how XDnd interacts with GNUsteps own drag & drop support. It will most likely require GNUstep backend code to be enhanced to make it work.

Improve the GUI. The current user interface is very basic, however as it is all GNUstep, new functionality should be easy to add.

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.