By Aaron Hampshire

Creating Web-Apps (Part 3)

This is the third article in a four-part series describing how to create web apps in elementary OS. Today, we will look at Midori apps.

Browser Launcher

If you are in Midori, you may launch any link as a web-app from your bookmark bar or shortcut menu.

First, navigate to your site. In our example, we'll use the NY Times. Click the bookmark star, select the appropriate options, and mark the "Run as wep application" box.
When you are in Midori, you may launch the web-app by clicking on the bookmark.
A little underwhelming? Let's turn to a more integrated desktop approach, albeit a little more difficult.

Midori Web-App Launchers

To create a Midori Web-App that feels more integrated into elementary Luna, we will need to create a desktop launcher.

To do this, open the Scratch text-editor and paste in the following text. #!/usr/bin/env xdg-open
[Desktop Entry]
Exec=midori --app=http://ADDRESS OF WEB-APP
You will need to change the Name, Exec, and Icon lines to fit your particular web-app. In our NY Times example, our Scratch file looks like this:
Save the file as YOU_CHOSE_A_NAME.desktop to ~/.local/share/applications. (Note: You will need to press CTRL+H to show the hidden folders.)
After we save the file, our application should show up in Slingshot.

Looking Forward

If the preceding process seemed unnecessarily complicated compared with Fogger and Chrome, you are not alone. There is a blueprint out that would integrate Unity's Web API, allowing the following:
  • When navigating a supported website, show the prompt "Would you like to integrate {webapp} with the desktop?"
  • If the user agrees, create a new app (like Fogger does).
  • Launch the newly created app immediately.
  • If the user wants to launch the app later, it will be found in Slingshot
Sounds promising!