Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,20 @@ sudo make uninstall
```


## Where things are stored

Each Liquid app is a single `.liquid` file: an XML document containing everything about that app
(settings, custom CSS and JavaScript, window state, cookies, icon).
Liquid apps reside in the `apps` directory inside of Liquid's data directory, which is located at:

- GNU/Linux, BSD, and others: `~/.liquid/`
- macOS: `~/Library/Application Support/Liquid/`
- Windows: `%LOCALAPPDATA%\Liquid\`

Keep in mind that `.liquid` files may contain secrets (cookies, proxy credentials).


## Customize

Placing a file named `liquid.qss` into `~/.config/liquid/` will serve as additional stylesheet for the program.
Placing a file named `liquid.qss` into Liquid's data directory will serve as additional stylesheet for the program.
You can use [base.qss](res/styles/base.qss) as reference.
3 changes: 2 additions & 1 deletion inc/liquid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class Liquid
static bool detectDarkModeUncached(void);
static QByteArray generateRandomByteArray(const int byteLength);
static QDir getAppsDir(void);
static QDir getConfigDir(void);
static QDir getDataDir(void);
static QString getLiquidAppFilePath(const QString liquidAppName);
static QString getDefaultUserAgentString(void);
static QStringList getLiquidAppsList(void);
static void raiseWindow(QWidget* window);
Expand Down
22 changes: 22 additions & 0 deletions inc/liquidappfile.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once

#include <QSettings>

// The .liquid file format: a single, human-readable XML file per Liquid app, containing everything about it
// (settings, custom CSS and JS, state, cookies, icon), with multi-line code stored verbatim in CDATA sections.
//
// It's plugged into QSettings as a custom format, so the rest of the program keeps working with familiar
// QSettings keys (e.g. "URL", "Proxy/Host"), while this class maps them to and from XML.
class LiquidAppFile
{
public:
// Registers the format with QSettings upon first use
static QSettings::Format format(void);

// Opens the .liquid file of the Liquid app by the given name (the caller takes ownership)
static QSettings* open(const QString& liquidAppName);

private:
static bool read(QIODevice& device, QSettings::SettingsMap& map);
static bool write(QIODevice& device, const QSettings::SettingsMap& map);
};
6 changes: 4 additions & 2 deletions inc/liquidappwindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public slots:

private:
void takeSnapshot(const bool fullPage);
void rememberGeometry(void);
static bool isPositionManagedByWindowSystem(void);
QImage captureFullPage(void);
void renderSnapshot(QPainter* painter);
void flash(void);
Expand All @@ -69,15 +71,15 @@ public slots:
void waitForNextFrame(void);
bool waitForDocumentToFinishLoading(void);

QString* liquidAppName;
QString liquidAppName;

QString liquidAppWindowTitle;
QIcon iconToSave;

LiquidAppWebPage* liquidAppWebPage = Q_NULLPTR;
QWebEngineProfile* liquidAppWebProfile = Q_NULLPTR;
QWebEngineSettings* liquidAppWebSettings = Q_NULLPTR;
QByteArray liquidAppWindowGeometry;
QRect rememberedGeometry; // Window geometry while in normal state (neither maximized nor full-screen)
QTimer* rememberGeometryTimer = Q_NULLPTR;
QList<qreal> zoomFactors;

Expand Down
9 changes: 8 additions & 1 deletion inc/lqd.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/* Various globals */
#define LQD_PROG_TITLE "Liquid"
#define LQD_APPS_DIR_NAME "apps"
#define LQD_APP_FILE_EXTENSION "liquid"
#define LQD_DEFAULT_BG_COLOR Qt::white
#define LQD_DEFAULT_PROXY_HOST "0.0.0.0"
#define LQD_DEFAULT_PROXY_PORT 8080
Expand Down Expand Up @@ -76,7 +77,13 @@
#define LQD_CFG_KEY_NAME_USE_CUSTOM_BG "UseCustomBackground" // boolean, defaults to FALSE
#define LQD_CFG_KEY_NAME_USER_AGENT "UserAgent" // text
#define LQD_CFG_KEY_NAME_URL "URL" // text, required
#define LQD_CFG_KEY_NAME_WIN_GEOM "WindowGeometry" // text
#define LQD_CFG_KEY_NAME_WIN_GEOM "WindowGeometry" // text (used only by the main window)
#define LQD_CFG_KEY_NAME_WIN_X "WindowX" // number
#define LQD_CFG_KEY_NAME_WIN_Y "WindowY" // number
#define LQD_CFG_KEY_NAME_WIN_WIDTH "WindowWidth" // number
#define LQD_CFG_KEY_NAME_WIN_HEIGHT "WindowHeight" // number
#define LQD_CFG_KEY_NAME_WIN_MAXIMIZED "WindowMaximized" // boolean, defaults to FALSE
#define LQD_CFG_KEY_NAME_WIN_FULLSCREEN "WindowFullScreen" // boolean, defaults to FALSE
#define LQD_CFG_KEY_NAME_ZOOM_LVL "ZoomLevel" // number, defaults to 1

/* Keyboard shortcuts (all windows and dialog boxes) */
Expand Down
2 changes: 2 additions & 0 deletions liquid.pro
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ INCLUDEPATH += $${INC_DIR}

HEADERS += inc/lqd.h \
inc/liquid.hpp \
inc/liquidappfile.hpp \
inc/liquidappcookiejar.hpp \
inc/liquidappconfigwindow.hpp \
inc/liquidappwebpage.hpp \
Expand All @@ -33,6 +34,7 @@ HEADERS += inc/lqd.h \
inc/svgsnapshot.hpp \

SOURCES += src/liquid.cpp \
src/liquidappfile.cpp \
src/liquidappcookiejar.cpp \
src/liquidappconfigwindow.cpp \
src/liquidappwebpage.cpp \
Expand Down
13 changes: 9 additions & 4 deletions sample-apps/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Sample Liquid apps

Copy files from directory `apps` into `~/.config/liquid/apps/`
and then load them by running `liquid <app-name>`, e.g.:
Copy `.liquid` files from this directory into Liquid's `apps` directory, and then run them using `liquid <app-name>`:

mkdir -p ~/.config/liquid/apps/
cp -n apps/* ~/.config/liquid/apps/
mkdir -p ~/.liquid/apps/
cp -n *.liquid ~/.liquid/apps/
liquid hackernews

Liquid's `apps` directory is located at:

- GNU/Linux, BSD, and others: `~/.liquid/apps/`
- macOS: `~/Library/Application Support/Liquid/apps/`
- Windows: `%LOCALAPPDATA%\Liquid\apps\`
9 changes: 0 additions & 9 deletions sample-apps/fccid.ini

This file was deleted.

9 changes: 9 additions & 0 deletions sample-apps/fccid.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<liquid version="1">
<url>https://fccid.io/</url>
<title>FCCID</title>
<javascript enabled="false"/>
<cookies enabled="false" third-party="false"/>
<window width="1021" height="1645" locked="true"/>
<viewport zoom="1"/>
</liquid>
9 changes: 0 additions & 9 deletions sample-apps/github.ini

This file was deleted.

9 changes: 9 additions & 0 deletions sample-apps/github.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<liquid version="1">
<url>https://github.com</url>
<title>GitHub</title>
<javascript enabled="true"/>
<cookies enabled="true" third-party="false"/>
<window width="1066" height="613"/>
<viewport zoom="0.9" custom-background="true" background-color="#24292e"/>
</liquid>
13 changes: 0 additions & 13 deletions sample-apps/hackernews.ini

This file was deleted.

13 changes: 13 additions & 0 deletions sample-apps/hackernews.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<liquid version="1">
<url>https://news.ycombinator.com/</url>
<domains>
<domain>hn.algolia.com</domain>
<domain>www.ycombinator.com</domain>
</domains>
<javascript enabled="true"/>
<cookies enabled="true" third-party="false"/>
<window width="465" height="944" locked="false"/>
<viewport zoom="0.9" hide-scrollbars="true" custom-background="true" background-color="#f6f6ef"/>
<icon type="image/png">iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAMkklEQVR4nO3deXCU9R3H8c+GIJcB8eKSailVOVQs4lUKCBEQUqutdXTa2unUek3rwagol6HaKmprPcaOrVTHacdWlHBqAgiKHFU5PBAECwVBDhEhYAghJNs/ntaxo0Cyv+/uPrvf9+tPBz+7Q5L3PmT3eZ5E8jo9pzr9UAWSkgKQ7xKS6iU10aRE8lol+cEHHEpIBdl+DgCyp4BXf8CpJEcAgGsEAHCMAACOEQDAMQIAO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uXS0v+nv7HWbtIemd6+h8HGUEA8snUsem/DBd3980rBCCfbF8rvfbn9O2/O1P6YH769pFxBCDfzLw7Pe/NJ+ulKSneYASxRQDyTbpuxvHGs9Kmd+x3kVUEIB/NekCqMvx8fl1t9L4/8g4ByEfVRncX/p/5T0ifrLPbQ2wQgHz1ymPSzo3hOzVV0Wf+kZcIQL6qrZFWzwvfefkhafe28B3EEgHAoa3gGv/5jAAAjhEAwDECADhGAADHCADgGAEAHCMAgGMEAHCMAACOEQDAMQIAOEYAAMcIAOAYAQAcIwCAYwQAcIwAAI4RAMAxAgA4RgAAxwgA4BgBABwjAIBjBABwjAAAjhEAwDECADhGAADHCADgGAEAHCMAgGMEAHCMAACOEQDAMQIAOEYAAMcIAOAYAQAcIwCAYwQAcIwAAI4RAMAxAgA4RgAAxwgA4BgBABwjAIBjBABwjAAAjhEAwDECADhGAADHEslrlMz2kwCQHRwBAI4RAMAxAgA4RgAAxwgA4BgBABwjAIBjBABwjAAAjhEAwDECADhGAADHCADgGAEAHCMAgGMEAHCMAACOEQDAMQIAOEYAAMcIAOAYAQAcIwCAYwQAcIwAAI4RAMAxAgA4RgAAxwgA4BgBABwjAIBjBABwjAAAjhEAwDECADhGAADHCADgGAEAHCMAgGMEAHCMAACOEQDAMQIAOEYAAMcIAOAYAQAcIwCAYwQAcIwAAI4RAMAxAgA4RgAAxwgA4FiBEtl+CgCyIsERAOBagRKapKTEkQDgREL678/8pP8AKm2ChN3yvJcAAAAASUVORK5CYII=</icon>
</liquid>
5 changes: 0 additions & 5 deletions sample-apps/http-auth-demo.ini

This file was deleted.

6 changes: 6 additions & 0 deletions sample-apps/http-auth-demo.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<liquid version="1">
<url>https://authenticationtest.com/HTTPAuth/</url>
<javascript enabled="false"/>
<cookies enabled="false" third-party="false"/>
</liquid>
Loading
Loading