June 16, 2017

Apps from Website in Gnome 3

The following steps helped me create an app for a website/webservice such as Facebook on Gnome-3. This is based on the steps provided at https://blogs.gnome.org/xan/2011/08/31/web-application-mode-in-gnome-3-2/. The key difference here is that I wanted the data of each app to be isolated from the other apps created using Web. 

1. Open Epiphany in private browsing mode. For example 

#> epiphany --incognito-mode --profile /home/username/.config/epiphany

2.  Open the URL. In this case https://www.facebook.com

3. Select save as Web application. You need to go to the settings menu described in  https://blogs.gnome.org/xan/2011/08/31/web-application-mode-in-gnome-3-2/

4. Because you are in private browsing mode, the profile used for the web app is independent of the default profile used by Epiphany. This ensures that the webapp cookies and browsing history is unique and specific to the application. This ensures each app is isolated. 

5. In the /home/username/.local/share/applications you should see a link to a file named epiphany-facebook-.... .desktop -> /tmp/.... . You need to copy that file from the /tmp folder and rename it as epiphany-facebook.desktop. 

6. Now you need to create a folder named epiphany-facebook in /home/username/.config 

7. Copy the contents from /tmp/epiphany... folder to the folder you created in .config. , .i.e., copy the contents from the folder from where you copied the epiphany-facebook-... .desktop  file to the newly created folder in /home/username/.config/epiphany-facebook/

8. Now open the epiphany-facebook.desktop file and update the Exec, Icon, and  StartupWMClass descriptions. 
....
Exec=epiphany --application-mode --profile="/home/username/.config/epiphany-facebook" https://www.facebook.com/
...
Icon=/home/username/.config/epiphany-facebook/app-icon.png
StartupWMClass=epiphany-facebook
...

9. You might need to restart gnome to see the Facebook application in the menu.

If you create multiple apps such as one app for Facebook, another for Twitter, and the third one for Gmail, then each of these apps will be using a different data store and their data and cookies will be isolated  from each other.

The downside of using apps is that if you click on a link which opens a new page then it opens a new browser instance/window. I found this unsuitable for services such as overleaf.




No comments: