Easy solution
Close all Firefox windows (also this one!). Run firefox -ProfileManager
and add a new profile for your web application. You can then remove the tab bar in the preferences and all other disturbing GUI elements. Close everything and run the profile manager again to select your default profile this time. Now Firefox should start your default profile if you untick "ask everytime".
Then create a file my_webapplication.desktop
and create a launcher. This is an example for the Google calendar:
[Desktop Entry]
Name=Google Calendar
Exec=firefox -P gcalendar -no-remote
Terminal=false
Type=Application
Icon=firefox
The icon should be better not firefox, but a path to a icon of your choice.
gcalendar
is the profile name I chose before.
Improvement
If your application is already open, opening this launcher again will result in an error. You can install wmctrl
and use this small script to run your web application:
# Is there any window with Google Calendar in the title?
if [ -z "`wmctrl -l|grep 'Google Calendar'`" ]; then
# No --> run it
firefox -P gcalendar -no-remote;
else
# Yes --> change focus to this window
wmctrl -a 'Google Calendar';
fi
Use Chromium
Well... I ḱind of gave up. Chromium is the easiest solution. Just click "Create application shortcut..." (in "Tools") and you're done. You'll find a *.desktop file in ~/.local/share/applications
which can be customized.
You might want to customize the *.desktop file. E.g. docky does not recognize a Chromium web application as a different application, so the Chromium icon is displayed instead. You can change this behaviour using the WMClass as described here. But you will have to add also a parameter --class=MyArbitraryChromiumAppname
as discussed in this bug report. If you want to run Google Calendar your *.desktop file in .local/share/applications/
should look like this:
[Desktop Entry]
Version=1.0
Name=Google Calendar
Exec=/usr/bin/chromium-browser "--app=https://www.google.com/calendar/render?gsessionid=HERE_GOES_THE_SESSION_ID_CREATED_AUTOMATICALLY" --class=gcal
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=/home/peter/.icons/google_calendar.png
Categories=Network;WebBrowser;
StartupNotify=true
StartupWMClass=gcal
Note: you have to add --class=gcal
and set the property StartupWMClass=gcal
(you can choose any name instead of gcal).
TL;DR: It's an issue with fontconfig
before version 2.13. It can be fixed by upgrading the package to 2.13 or higher (though I couldn't find a suitable provider). Alternatively, examine all your fonts-related folders and config files in your home directory and test if removing any of them resolves your issue. For me, renaming ~/.fonts
did the trick.
After learning about the bug reports https://bugzilla.mozilla.org/show_bug.cgi?id=1495900 and https://bugzilla.mozilla.org/show_bug.cgi?id=1411338 it becomes rather clear that the problem must be caused by fontconfig
.
Somehow when Chromium starts, it triggers a change in the fonts database (???), which causes Firefox - if currently running - to re-scan the file system for fonts somehow, resulting in the CPU usage and temporary freeze.
Apparently updating the fontconfig
package from version 2.11 to 2.13 (the version shipped e.g. in Ubuntu 18.10) should fix the issue, but I found no easy way to get that version on 16.04, without breaking dependencies of lots of other packages I have installed.
So as the issue is limited to my user account, I examined my user's local font configuration and folders. There's quite a mess of different font-related directories to be honest, including ~/.fonts
, ~/.local/share/fonts
, ~/.local/share-font-manager
, ~/.config/font-manager
, ~/.cache/font-manager
, ~/.cache/fontconfig
and a few more config files and application-specific font stuff.
I started by removing (renaming) the ~/.fonts
folder, as it didn't seem to contain anything useful anyway, and a simple touch ~/.fonts/Library/
before that triggered the Firefox misbehaviour. After that folder was gone, so was the issue when launching Chromium. \o/
Best Answer
I have an easier way I usually do this. It works with a stock Firefox installation without any customization. You can even change the height and width of the window.
The command:
Just change
http://google.com
to the URL. You can also change the height and width variables (in pixels).