main/qtwebbrowser: remove (MR 3589)

Remove this obsolete package. It was added four years ago because we
didn't have working webbrowsers and hasn't been updated since.
This commit is contained in:
Oliver Smith 2022-10-25 09:11:04 +02:00
parent b47abadccc
commit c102971e27
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
6 changed files with 0 additions and 737 deletions

View file

@ -1,479 +0,0 @@
From 14bdd49c5f21ff642d60b119c082c2d48a561b30 Mon Sep 17 00:00:00 2001
From: Pierre Parent <pierre.parent@pparent.fr>
Date: Sun, 23 Sep 2018 18:29:53 +0200
Subject: [PATCH 1/1] Patch for usability on postmarketOS
---
src/appengine.cpp | 37 +++++++++++++++++++++++++
src/appengine.h | 2 ++
src/main.cpp | 41 +++++++++++++++-------------
src/qml/BrowserWindow.qml | 15 +++++++++--
src/qml/NavigationBar.qml | 69 ++++++++++++++++++++++-------------------------
src/qml/PageView.qml | 42 +++++++++++++----------------
6 files changed, 125 insertions(+), 81 deletions(-)
diff --git a/src/appengine.cpp b/src/appengine.cpp
index f48325d..b32078a 100644
--- a/src/appengine.cpp
+++ b/src/appengine.cpp
@@ -33,6 +33,7 @@
#include <QtCore/QStandardPaths>
#include <QStringBuilder>
#include <QCoreApplication>
+#include <QTextStream>
AppEngine::AppEngine(QObject *parent)
: QObject(parent)
@@ -105,3 +106,39 @@ void AppEngine::saveSetting(const QString &name, const QString &value)
m_settings.setValue(name, value);
}
+
+bool AppEngine::writeFile(const QString& source, const QString& data)
+ {
+ if (source.isEmpty())
+ return false;
+
+ QFile file(source);
+ if (!file.open(QFile::WriteOnly | QFile::Truncate))
+ return false;
+
+ QTextStream out(&file);
+ out << data;
+ file.close();
+
+ return true;
+ }
+
+QString AppEngine::readFile(const QString& source)
+ {
+ if (source.isEmpty())
+ return "";
+
+ QFile file(source);
+ if(!file.open(QIODevice::ReadOnly)) {
+ return "";
+ }
+
+ QTextStream in(&file);
+
+ if (!in.atEnd()) {
+ QString line = in.readLine();
+ return line;
+ }
+ else
+ return "";
+ }
diff --git a/src/appengine.h b/src/appengine.h
index c5ad20e..c7a374e 100644
--- a/src/appengine.h
+++ b/src/appengine.h
@@ -83,6 +83,8 @@ public:
Q_INVOKABLE QString fallbackColor();
Q_INVOKABLE QString restoreSetting(const QString &name, const QString &defaultValue = QString());
Q_INVOKABLE void saveSetting(const QString &name, const QString &value);
+ Q_INVOKABLE bool writeFile(const QString& source, const QString& data);
+ Q_INVOKABLE QString readFile(const QString& source);
private:
QSettings m_settings;
diff --git a/src/main.cpp b/src/main.cpp
index 2181f15..e462b9b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -31,15 +31,17 @@
#include "navigationhistoryproxymodel.h"
#include "touchtracker.h"
-#if defined(DESKTOP_BUILD)
-#include "touchmockingapplication.h"
-#endif
-
#include <QGuiApplication>
#include <QQmlContext>
#include <QQmlEngine>
#include <QQuickView>
#include <QtWebEngine/qtwebengineglobal.h>
+#include <QtWebEngine>
+#include <csignal>
+#include <iostream>
+
+using namespace std;
+
static QObject *engine_factory(QQmlEngine *engine, QJSEngine *scriptEngine)
{
@@ -50,7 +52,15 @@ static QObject *engine_factory(QQmlEngine *engine, QJSEngine *scriptEngine)
}
int main(int argc, char **argv)
-{
+{
+ //Handle the signals
+ signal(SIGINT, SIG_IGN);
+ signal(SIGSEGV, SIG_IGN);
+ signal(SIGABRT, SIG_IGN);
+ signal(SIGIOT, SIG_IGN);
+ signal(SIGILL, SIG_IGN);
+ signal(SIGBUS, SIG_IGN);
+
qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
//do not use any plugins installed on the device
@@ -71,24 +81,23 @@ int main(int argc, char **argv)
int qAppArgCount = qargv.size();
-#if defined(DESKTOP_BUILD)
- TouchMockingApplication app(qAppArgCount, qargv.data());
-#else
+
QGuiApplication app(qAppArgCount, qargv.data());
-#endif
+
+ QtWebEngine::initialize();
+
qmlRegisterType<NavigationHistoryProxyModel>("WebBrowser", 1, 0, "SearchProxyModel");
qmlRegisterType<TouchTracker>("WebBrowser", 1, 0, "TouchTracker");
qmlRegisterSingletonType<AppEngine>("WebBrowser", 1, 0, "AppEngine", engine_factory);
- QtWebEngine::initialize();
-
+
app.setOrganizationName("The Qt Company");
app.setOrganizationDomain("qt.io");
app.setApplicationName("qtwebbrowser");
QQuickView view;
- view.setTitle("Yet Another Browser");
+ view.setTitle("Qt WebBrowser");
view.setFlags(Qt::Window | Qt::WindowTitleHint);
view.setResizeMode(QQuickView::SizeRootObjectToView);
view.setColor(Qt::black);
@@ -96,13 +105,7 @@ int main(int argc, char **argv)
QObject::connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));
-#if defined(DESKTOP_BUILD)
- view.show();
- if (view.size().isEmpty())
- view.setGeometry(0, 0, 800, 600);
-#else
- view.showFullScreen();
-#endif
+ view.showMaximized();
app.exec();
}
diff --git a/src/qml/BrowserWindow.qml b/src/qml/BrowserWindow.qml
index 05ddcff..d1d0c73 100644
--- a/src/qml/BrowserWindow.qml
+++ b/src/qml/BrowserWindow.qml
@@ -189,7 +189,7 @@ Item {
return false
return true
}
-
+
anchors {
top: navigation.bottom
left: parent.left
@@ -205,9 +205,20 @@ Item {
return
navigation.webView = tab.webView
- var url = AppEngine.initialUrl
+ var url = AppEngine.readFile("/tmp/qt-WebBrowser-last-url.txt")
+
+ tabView.page_view_url=url;
navigation.load();
+
+ if ( url == "" )
+ {
+ homeScreen.messageBox.state = "disabled"
+ homeScreen.state = "enabled"
+ homeScreen.forceActiveFocus()
+ }
+
+
}
onCurrentIndexChanged: {
if (!tabView.get(tabView.currentIndex))
diff --git a/src/qml/NavigationBar.qml b/src/qml/NavigationBar.qml
index 742ca47..0ee6388 100644
--- a/src/qml/NavigationBar.qml
+++ b/src/qml/NavigationBar.qml
@@ -40,6 +40,7 @@ ToolBar {
property alias addressBar: urlBar
property Item webView: null
+ property bool moreButtons: false
onWebViewChanged: {
@@ -159,10 +160,7 @@ ToolBar {
}
Rectangle {
width: 1
- anchors {
- top: parent.top
- bottom: parent.bottom
- }
+ height: parent.height
color: uiSeparatorColor
}
UIButton {
@@ -175,19 +173,13 @@ ToolBar {
}
Rectangle {
width: 1
- anchors {
- top: parent.top
- bottom: parent.bottom
- }
+ height: parent.height
color: uiSeparatorColor
}
Rectangle {
Layout.fillWidth: true
implicitWidth: 10
- anchors {
- top: parent.top
- bottom: parent.bottom
- }
+ height: parent.height
color: uiColor
}
TextField {
@@ -286,10 +278,7 @@ ToolBar {
visible: !cancelButton.visible
Layout.fillWidth: true
implicitWidth: 10
- anchors {
- top: parent.top
- bottom: parent.bottom
- }
+ height: parent.height
color: uiColor
}
@@ -313,18 +302,18 @@ ToolBar {
}
Rectangle {
width: 1
- anchors {
- top: parent.top
- bottom: parent.bottom
- }
+ height: parent.height
color: uiSeparatorColor
}
- UIButton {
+
+ UIButton {
id: homeButton
source: "icons/Btn_Home.png"
+ visible:moreButtons
color: uiColor
highlightColor: buttonPressedColor
onClicked: {
+ moreButtons = false
if (homeScreen.state == "disabled" || homeScreen.state == "edit") {
homeScreen.messageBox.state = "disabled"
homeScreen.state = "enabled"
@@ -336,18 +325,17 @@ ToolBar {
}
Rectangle {
width: 1
- anchors {
- top: parent.top
- bottom: parent.bottom
- }
+ height: parent.height
color: uiSeparatorColor
}
UIButton {
id: pageViewButton
+ visible:moreButtons
source: "icons/Btn_Tabs.png"
color: uiColor
highlightColor: buttonPressedColor
- onClicked: {
+ onClicked: {
+ moreButtons = false
if (tabView.viewState == "list") {
tabView.viewState = "page"
} else {
@@ -371,23 +359,22 @@ ToolBar {
}
Rectangle {
width: 1
- anchors {
- top: parent.top
- bottom: parent.bottom
- }
+ height: parent.height
color: uiSeparatorColor
}
UIButton {
id: bookmarksButton
color: uiColor
highlightColor: buttonPressedColor
- enabled: urlBar.text != "" && !settingsView.privateBrowsingEnabled
+ enabled: true
+ visible:moreButtons
property bool bookmarked: false
source: bookmarked ? "icons/Btn_Bookmark_Checked.png" : "icons/Btn_Bookmarks.png"
onClicked: {
- if (!webView)
- return
+ moreButtons = false
var icon = webView.loading ? "" : webView.icon
+ icon=icon.toString().replace("image://favicon/", "");
+ bookmarked = true
var idx = homeScreen.contains(webView.url.toString())
if (idx !== -1) {
homeScreen.remove("", idx)
@@ -400,21 +387,29 @@ ToolBar {
}
Component.onCompleted: refresh()
}
+
Rectangle {
width: 1
- anchors {
- top: parent.top
- bottom: parent.bottom
- }
+ height: parent.height
color: uiSeparatorColor
}
+
UIButton {
id: settingsButton
source: "icons/Btn_Settings.png"
color: uiColor
highlightColor: buttonPressedColor
onClicked: {
+ if ( ! moreButtons )
+ {
+ moreButtons = true
+ return
+ }
+ else
+ {
settingsView.state = "enabled"
+ moreButtons = false
+ }
}
}
}
diff --git a/src/qml/PageView.qml b/src/qml/PageView.qml
index f7e0448..d31bc69 100644
--- a/src/qml/PageView.qml
+++ b/src/qml/PageView.qml
@@ -49,6 +49,7 @@ Rectangle {
property alias count: pathView.count
property string viewState: "page"
+ property string page_view_url: ""
onViewStateChanged: {
if (viewState == "page" || viewState == "fullscreen")
@@ -107,13 +108,19 @@ Rectangle {
WebEngineView {
id: webEngineView
-
+ url: parent.parent.page_view_url
+
+ profile: WebEngineProfile{
+ httpUserAgent: "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 5 Build/LMY48B; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.65 Safari/537.361"
+ persistentCookiesPolicy : WebEngineProfile.ForcePersistentCookies
+ persistentStoragePath : "~/.qtwebbrowser/"
+ }
+
anchors {
fill: parent
top: permBar.bottom
}
- profile: settingsView.privateBrowsingEnabled ? otrProfile : defaultProfile
enabled: root.interactive
function takeSnapshot() {
@@ -134,7 +141,11 @@ Rectangle {
}
// Trigger a refresh to check if the new url is bookmarked.
- onUrlChanged: navigation.refresh()
+ onUrlChanged:
+ {
+ AppEngine.writeFile("/tmp/qt-WebBrowser-last-url.txt",webEngineView.url)
+ navigation.refresh()
+ }
settings.autoLoadImages: settingsView.autoLoadImages
@@ -295,10 +306,7 @@ Rectangle {
anchors.fill: parent
Rectangle {
width: 5
- anchors {
- top: parent.top
- bottom: parent.bottom
- }
+ height: parent.height
color: uiColor
}
TextField {
@@ -324,18 +332,12 @@ Rectangle {
}
Rectangle {
width: 5
- anchors {
- top: parent.top
- bottom: parent.bottom
- }
+ height: parent.height
color: uiColor
}
Rectangle {
width: 1
- anchors {
- top: parent.top
- bottom: parent.bottom
- }
+ height: parent.height
color: uiSeparatorColor
}
UIButton {
@@ -346,10 +348,7 @@ Rectangle {
}
Rectangle {
width: 1
- anchors {
- top: parent.top
- bottom: parent.bottom
- }
+ height: parent.height
color: uiSeparatorColor
}
UIButton {
@@ -360,10 +359,7 @@ Rectangle {
}
Rectangle {
width: 1
- anchors {
- top: parent.top
- bottom: parent.bottom
- }
+ height: parent.height
color: uiSeparatorColor
}
UIButton {
--
2.11.0

View file

@ -1,36 +0,0 @@
pkgname=qtwebbrowser
pkgver=1.0
pkgrel=2
pkgdesc="Qt web browser"
url="http://doc.qt.io/QtWebBrowser/"
arch="all !armhf !armv7" # armhf: pmaports#75, armv7: build.postmarketos.org#72
license="GPLv3"
depends="qt5-qtbase qt5-qtwebengine qt5-qtvirtualkeyboard qt5-qtquickcontrols qt5-qtgraphicaleffects mesa-dev"
makedepends="qt5-qtbase-dev qt5-qtwebengine-dev busybox"
install="qtwebbrowser.post-install"
source="$pkgname-$pkgver.tar.gz::https://github.com/qtproject/qt-apps-qtwebbrowser/archive/v$pkgver.tar.gz qtwebbrowser.svg startup-qtwebbrowser.sh qtwebbrowser.desktop 0001-Patch-for-usability-on-postmarketOS.patch"
builddir="$srcdir/qt-apps-qtwebbrowser-$pkgver/"
build() {
cd "$builddir/src/"
/usr/lib/qt5/bin/qmake src.pro
make
}
package() {
cd "$builddir/src/"
mkdir -p $pkgdir/usr/bin/
install -D -m755 qtwebbrowser $pkgdir/usr/bin/qtwebbrowser-bin
install -D -m755 "$srcdir"/startup-qtwebbrowser.sh "$pkgdir"/usr/bin/qtwebbrowser
install -D -m644 "$srcdir"/qtwebbrowser.svg "$pkgdir"/usr/share/icons/hicolor/scalable/apps/qtwebbrowser.svg
install -D -m644 "$srcdir"/qtwebbrowser.desktop "$pkgdir"/usr/share/applications/qtwebbrowser.desktop
}
sha512sums="
a385ef2c6459733606945bc3a6857bfbc725fa04224ee4309196220c3a9be177d52bbaf0bab57fac7a15b38920b8d19852db04451bdbdadb4f03a7f5803319ab qtwebbrowser-1.0.tar.gz
5e14de5c4c8aec79f3ab25947e1f4091fdbf9a38a894229d1f636dbbb17480970e3c9d7dfdf7cc57e42246a55058025ee3e200145115cfea507f0611aaa3dd77 qtwebbrowser.svg
008998972cb836327203a740e0fa2929a4028b70366597ed0f21640f1383ed93630c40f2e0eb4fea59a8b8367e825c321803c8b5f73b16def4dbe31f5d9fbc69 startup-qtwebbrowser.sh
681a1275f7d09991cdffe9a0f86aa9af22103807d02fd24e806a46e79c8eacb4eea907ef1a677d5eacc379e0666934b346662c99e76026e3dc7820df162a9fe6 qtwebbrowser.desktop
6802f908973d29dc73f87df831cc4303dfc2eaf11a082341d1ff4618bbbcb712e858cab20bf67ed6cc2ef5eacfb44f80ec04d3765890b49ce510040d01986880 0001-Patch-for-usability-on-postmarketOS.patch
"

View file

@ -1,77 +0,0 @@
[Desktop Entry]
Exec=qtwebbrowser
Icon=qtwebbrowser
Type=Application
Terminal=false
Name=Qtweb
GenericName=Web Browser
GenericName[af]=Web Blaaier
GenericName[ar]=متصفح ويب
GenericName[az]=Veb Səyyahı
GenericName[bg]=Браузър
GenericName[bn]=
GenericName[br]=Furcher ar Gwiad
GenericName[bs]=WWW Preglednik
GenericName[ca]=Fullejador web
GenericName[cs]=WWW prohlížeč
GenericName[cy]=Porydd Gwe
GenericName[da]=Browser
GenericName[de]=Web-Browser
GenericName[el]=Περιηγητής Ιστού
GenericName[eo]=TTT-legilo
GenericName[es]=Navegador web
GenericName[et]=Veebilehitseja
GenericName[eu]=Web arakatzailea
GenericName[fa]=مرورگر وب
GenericName[fi]=WWW-selain
GenericName[fo]=Alnótsfar
GenericName[fr]=Navigateur web
GenericName[gl]=Navegador Web
GenericName[he]=דפדפן אינטרנט
GenericName[hi]=
GenericName[hr]=Web preglednik
GenericName[hu]=Webböngésző
GenericName[is]=Vafri
GenericName[it]=Browser Web
GenericName[ja]=
GenericName[ko]=
GenericName[lo]=
GenericName[lt]=Žiniatinklio naršyklė
GenericName[lv]=Web Pārlūks
GenericName[mk]=Прелистувач на Интернет
GenericName[mn]=Веб-Хөтөч
GenericName[nb]=Nettleser
GenericName[nds]=Nettkieker
GenericName[nl]=Webbrowser
GenericName[nn]=Nettlesar
GenericName[nso]=Seinyakisi sa Web
GenericName[pa]=
GenericName[pl]=Przeglądarka WWW
GenericName[pt]=Navegador Web
GenericName[pt_BR]=Navegador Web
GenericName[ro]=Navigator de web
GenericName[ru]=Веб-браузер
GenericName[se]=Fierpmádatlogan
GenericName[sk]=Webový prehliadač
GenericName[sl]=Spletni brskalnik
GenericName[sr]=Веб претраживач
GenericName[sr@Latn]=Veb pretraživač
GenericName[ss]=Ibrawuza yeWeb
GenericName[sv]=Webbläsare
GenericName[ta]= ி
GenericName[tg]=Тафсиргари вэб
GenericName[th]=
GenericName[tr]=Web Tarayıcı
GenericName[uk]=Навігатор Тенет
GenericName[uz]=Веб-браузер
GenericName[ven]=Buronza ya Webu
GenericName[vi]=Trình duyt Web
GenericName[wa]=Betchteu waibe
GenericName[xh]=Umkhangeli zincwadi we Web
GenericName[zh_CN]=
GenericName[zh_TW]=
GenericName[zu]=Umcingi we-Web
MimeType=text/html;
StartupNotify=true
Categories=Network;WebBrowser;
X-Desktop-File-Install-Version=0.23

View file

@ -1,11 +0,0 @@
#!/bin/sh
if [ ! -f "/usr/bin/libEGL.so" ]; then
ln -s /usr/lib/libEGL.so /usr/bin/libEGL.so
fi
if [ ! -f "/usr/bin/libGLESv2.so" ]; then
ln -s /usr/lib/libGLESv2.so /usr/bin/libGLESv2.so
fi
exit 0;

View file

@ -1,103 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="24.970833mm"
height="24.870832mm"
viewBox="0 0 24.970833 24.870832"
version="1.1"
id="svg5000"
inkscape:version="0.92.1 r15371"
sodipodi:docname="qtwebbrowser.svg">
<defs
id="defs4994" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="-460.14286"
inkscape:cy="-430.14285"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1366"
inkscape:window-height="716"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata4997">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-0.4157746,-10.153872)">
<g
transform="matrix(0.26564716,0,0,0.26458333,-15.523055,-61.283627)"
id="g231"
inkscape:transform-center-y="-12.09523">
<circle
class="st0"
cx="107"
cy="317"
r="47"
id="circle217"
style="fill:none" />
<g
id="g221">
<path
class="st5"
d="m 107,363 c -11.8,0 -23.6,-4.5 -32.5,-13.5 -17.9,-17.9 -17.9,-47.1 0,-65.1 17.9,-17.9 47.1,-17.9 65.1,0 17.9,17.9 17.9,47.1 0,65.1 v 0 c -9,9 -20.8,13.5 -32.6,13.5 z"
id="path219"
inkscape:connector-curvature="0"
style="fill:#46a2da" />
</g>
<path
class="st8"
d="m 153,317 c 0,-25.4 -20.6,-46 -46,-46 -12.7,0 -24.2,5.1 -32.5,13.5 l 65.1,65.1 C 147.9,341.2 153,329.7 153,317 Z"
id="path223"
inkscape:connector-curvature="0"
style="fill:#80c342" />
<g
id="g229">
<path
class="st5"
d="m 107,335 c -4.8,0 -9.3,-1.9 -12.7,-5.3 -7,-7 -7,-18.4 0,-25.5 3.4,-3.4 7.9,-5.3 12.7,-5.3 4.8,0 9.3,1.9 12.7,5.3 7,7 7,18.4 0,25.5 -3.4,3.4 -7.9,5.3 -12.7,5.3 z"
id="path225"
inkscape:connector-curvature="0"
style="fill:#46a2da" />
<path
class="st1"
d="m 122.2,329.9 c 6.7,-7.9 6.3,-19.6 -1.1,-27.1 -3.9,-3.9 -9,-5.9 -14.1,-5.9 -5.1,0 -10.2,2 -14.1,5.9 -7.8,7.8 -7.8,20.5 0,28.3 3.9,3.9 9,5.9 14.1,5.9 4.4,0 8.8,-1.4 12.4,-4.3 l 18.5,18.5 c 1,-0.9 1.9,-1.8 2.8,-2.8 z m -26.5,-1.6 c -6.2,-6.2 -6.2,-16.4 0,-22.6 3,-3 7,-4.7 11.3,-4.7 4.3,0 8.3,1.7 11.3,4.7 6.2,6.2 6.2,16.4 0,22.6 -3,3 -7,4.7 -11.3,4.7 -4.3,0 -8.3,-1.7 -11.3,-4.7 z"
id="path227"
inkscape:connector-curvature="0"
style="fill:#ffffff" />
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.5 KiB

View file

@ -1,31 +0,0 @@
#!/bin/sh
rm -f /tmp/qt-WebBrowser-last-url.txt
crash_at_start=0
need_to_start=1
while [ "$need_to_start" -eq "1" ]; do
START=$(date +%s)
#Start the app with X11 and scale factor to 1.75
QT_SCALE_FACTOR=1.75 QT_QPA_PLATFORM=xcb qtwebbrowser-bin >/tmp/qtwebbrowserlog 2>&1
END=$(date +%s)
EXEC_TIME=$(( $END - $START ))
#See if it crashed at startup or not
if [ "$EXEC_TIME" -lt "17" ]; then
crash_at_start=$(( crash_at_start + 1 ))
else
crash_at_start=0;
fi
#If the browser did not crash we do not need to restart it
#It was closed intentionally by the user
#If it crashed 4 times in a row at startup don't try again
#in order to avoid loops
cat /tmp/qtwebbrowserlog | grep "Received signal"
if [ "$?" -ne "0" ] || [ "$crash_at_start" -ge "4" ]; then
need_to_start=0;
fi
done