Mobile html5 game for Librem5


I am developing a web based html5 game.
Try it on:
(Its designed for portrait mode. movement on keyboard with “wasd” and throw/kick on space)

I would like to test it in the kvm VM build of PureOS with touch simulation. I have the VM running but it is with mouse (simulation).
Does anyone know if this is possible?
Also I would like to add a link to a full screen page to the launcher, but i am not sure if this feature is already built into PureOS…

Br Magnus Jørgensen

1 Like

Oh i see there is a function for making a launcher

But it does not seem to work.

1 Like

I got some help from Guido (thanks Guido) to get my launcher on the favorites in the start screen. This is not automated as of todays date 16-Jan-2019, so added it manually with:

gsettings set sm.puri.phosh favorites “[‘org.gnome.Contacts.desktop’, ‘sm.puri.Calls.desktop’, ‘sm.puri.Chatty.desktop’, ‘org.gnome.Calendar.desktop’, ‘org.gnome.Evince.desktop’, ‘org.gnome.Epiphany.desktop’, ‘org.gnome.Terminal.desktop’, ‘’]”

The last entry is the shortcut entry that Epiphany made (see previous reply) .
Now my start shortcut is in the favorites

Getting it to start in full screen seems to be missing in Epiphany. I have added an issue in the purism source repo about this.

I installed Chromium and did the same thing.
Chromium has a bit better performance on html5 canvas and also has the possibility to go full screen. In fact Chromium covers both the top bar and the bottom bar when it goes fill screen, which is not optimal. But maybe that can be fixed. I’m not even sure if chromium will be built for the arm version of Phosh. Does any one know about that?

1 Like

I can’t say for sure, but if chromium is packaged for PureOS then there is at least a chance.


This locks like its available for arm64.


I have found a much better solution.
I was trying to make it work with GTK WebKit2, but for some reason loading the page fails. I’m more familiar with Qt so i tried with QWebEngineView.
This works perfectly.


import sys

from PyQt5.QtWebEngineWidgets import QWebEngineView
from PyQt5.QtCore import QEvent, Qt, QUrl, QMargins
from PyQt5.QtWidgets import *

app = QApplication(sys.argv)

class WebView(QWebEngineView):
	def __init__(self, parent):
		QWebEngineView.__init__(self, parent)


class MainWindow(QWidget):
	def __init__(self):
		QWidget.__init__(self, None)
		web_view = WebView(self)
		layout = QVBoxLayout()
		layout.setContentsMargins(QMargins(0, 0, 0, 0))

	def eventFilter(self, obj, event):
		if event.type() == QEvent.KeyRelease:
			if event.key() == Qt.Key_Escape:
				return True
		return False

mw = MainWindow()

This gives the same performance as on Chromium. and i can control the WebView behavior.
Strangely i have to set the windows size to half the resolution.
Unfortunately the window reference does not show up in the list of open apps.

1 Like

The need for half of the resolution might be due to the fact that on the phone there is HiDPI scaling on. So that things are in are reasonable size and not super tiny.


I have added tls to my service with letsencrypt:

This works with the newest versions of firefox and chrome, but not with Epiphany, my QWebEngineView solution or with Firefox 60 (from the Librem5 repo).
Does anyone know why this is?
If so, is there a solution?

The QWebEngineView solutions outputs the following to console:

qt5ct: using qt5ct plugin
[22379:22391:0129/] No URLRequestContext for NSS HTTP handler. host:
[22379:22391:0129/] CERT_PKIXVerifyCert for failed err=-8179
js: Uncaught ReferenceError: jstProcess is not defined

Epiphany result:

1 Like

Guido and Sean quickly found my mistake (thanks Guido and Sean).
I did not use the full certificate chain. It works now.

1 Like