sidewinder-viewer
v0.7.1
Published
The Sidewinder Viewer
Downloads
4
Maintainers
Readme
sidewinder viewer
A little trip down memory lane...
I wanted to use Electron to run Google calendar, inbox, Trello and so on, so that I could close a few of those tabs in my browser! But I didn't want to create and maintain a separate Electron app for each web app, since that would quickly become unwieldy.
So I decided to resurrect an old idea that myself and Phil Booth worked on nearly 10 years ago. Back then we were building an application framework called Sidewinder that used W3C standards such as XForms[1] and CSS to create desktop applications. It was pretty advanced and we were able to do some impressive things, but as often happens with these kinds of projects, you can sometimes be a little bit too early.
(See Sidewinder and GCal desktop applications for a quick introduction to the kinds of things we were doing.)
The core of our project used the SpiderMonkey JavaScript engine to power everything, and wired in 'renderers' -- essentially wrappers around a browser DOM -- that could be written to and controlled, for UI. We provided lots of hooks to make it easy to display and position windows, to add and control native menus, messages, and so on. And we sent back lots of notifications from the renderer to allow the app to control how the renderer behaved, by modifying windows before they were opened, URLs before they were used, XMLHttpRequests
before they were sent, and more.
In other words...a lot like Electron.
In fact, so much like Electron that it would be really easy to bring forward some of the ideas we had back than for Sidewinder, and put them into an Electron wrapper.
URLs for Apps
One of the simplest but perhaps most powerful features we had was the ability to create an 'app' using just a URL. The base of the URL would indicate which web page contained the app, and then the fragment part would indicate configuration options such as how large the initial window should be, where it should be positioned, and so on. This meant that only one desktop app was necessary to manage and control many different web apps.
The whole URL idea is explained in a blog post of 2007, Using URLs to pass parameters to web applications, widgets and gadgets.
More Sidewinder ideas can be seen in The 10 minute guide to Sidewinder (or 'How to turn a web app into a desktop app without programming')
Installation
To install globally:
npm install -g sidewinder-viewer
Upgrading
To force an upgrade to the latest version:
npm install -g sidewinder-viewer@latest -g
Usage
sidewinder "http://inbox.google.com#meta(width=1000,height=800)"
The possible options are those that are available when creating a new BrowserWindow()
.
To add a command inbox
that can be run from the command-line, just add a function to ~/.bash_aliases
:
function inbox
{
sidewinder "http://inbox.google.com#meta(width=1000,height=800)"
}
Typing inbox
at the command-line will now launch Google Inbox in Electron, and size the Electron window accordingly.
[1] Much of our XForms plugin was developed by Paul Butcher.