Prepare 1.8.6 web extension release

This commit is contained in:
waozi committed 2026-07-11 22:32:01 -03:00
1 parent 129c141d6d
commit 83c9a4eb70
22 files changed
+866 -73

No files matched your search

+54
View File
@@ -29,6 +29,7 @@ jobs:
with:
submodules: recursive
fetch-depth: 0
lfs: true
- name: Cache Test apt packages
uses: actions/cache@v4
@@ -65,6 +66,7 @@ jobs:
with:
submodules: recursive
fetch-depth: 0
lfs: true
- name: Cache Web apt packages
uses: actions/cache@v4
@@ -102,3 +104,55 @@ jobs:
make package-unpackaged-assets
make chrome-web-store
test -f build/dist/inbe-chrome-web-store.zip
build-firefox-addons:
name: Build Firefox Add-on
runs-on: ubuntu-latest
needs: test
env:
APT_CACHE_DIR: /tmp/apt-cache
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
lfs: true
- name: Cache Web apt packages
uses: actions/cache@v4
with:
path: ${{ env.APT_CACHE_DIR }}
key: web-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/web-packages.txt') }}
restore-keys: |
web-apt-${{ runner.os }}-${{ runner.arch }}-
- name: Install Web Dependencies
run: |
set -euo pipefail
mapfile -t packages < .github/apt/web-packages.txt
mkdir -p "$APT_CACHE_DIR/partial"
sudo apt-get update
sudo apt-get \
-o Dir::Cache::archives="$APT_CACHE_DIR" \
install -y "${packages[@]}"
sudo chown -R "$USER:$USER" "$APT_CACHE_DIR"
- name: Set up Emscripten
run: |
set -euo pipefail
git clone --depth 1 https://github.com/emscripten-core/emsdk.git "$HOME/emsdk"
"$HOME/emsdk/emsdk" install latest
"$HOME/emsdk/emsdk" activate latest
echo "EMSDK=$HOME/emsdk" >> "$GITHUB_ENV"
echo "EM_CONFIG=$HOME/emsdk/.emscripten" >> "$GITHUB_ENV"
echo "$HOME/emsdk" >> "$GITHUB_PATH"
echo "$HOME/emsdk/upstream/emscripten" >> "$GITHUB_PATH"
- name: Build Firefox Add-on ZIP
run: |
set -euo pipefail
make package-unpackaged-assets
make firefox-addons
test -f build/dist/inbe-firefox-addons.zip
+1
View File
@@ -24,6 +24,7 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive
lfs: true
- name: Install Packages
run: |
+116
View File
@@ -26,6 +26,7 @@ jobs:
with:
submodules: recursive
fetch-depth: 0
lfs: true
- name: Cache Test apt packages
uses: actions/cache@v4
@@ -62,6 +63,7 @@ jobs:
with:
submodules: recursive
fetch-depth: 0
lfs: true
- name: Cache Web apt packages
uses: actions/cache@v4
@@ -121,6 +123,7 @@ jobs:
with:
submodules: recursive
fetch-depth: 0
lfs: true
- name: Cache Web apt packages
uses: actions/cache@v4
@@ -167,6 +170,66 @@ jobs:
path: build/release/chrome-web-store/*
if-no-files-found: error
build-firefox-addons:
name: Build Firefox Add-on
runs-on: ubuntu-latest
needs: test
env:
APT_CACHE_DIR: /tmp/apt-cache
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
lfs: true
- name: Cache Web apt packages
uses: actions/cache@v4
with:
path: ${{ env.APT_CACHE_DIR }}
key: web-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/web-packages.txt') }}
restore-keys: |
web-apt-${{ runner.os }}-${{ runner.arch }}-
- name: Install Web Dependencies
run: |
set -euo pipefail
mapfile -t packages < .github/apt/web-packages.txt
mkdir -p "$APT_CACHE_DIR/partial"
sudo apt-get update
sudo apt-get \
-o Dir::Cache::archives="$APT_CACHE_DIR" \
install -y "${packages[@]}"
sudo chown -R "$USER:$USER" "$APT_CACHE_DIR"
- name: Set up Emscripten
run: |
set -euo pipefail
git clone --depth 1 https://github.com/emscripten-core/emsdk.git "$HOME/emsdk"
"$HOME/emsdk/emsdk" install latest
"$HOME/emsdk/emsdk" activate latest
echo "EMSDK=$HOME/emsdk" >> "$GITHUB_ENV"
echo "EM_CONFIG=$HOME/emsdk/.emscripten" >> "$GITHUB_ENV"
echo "$HOME/emsdk" >> "$GITHUB_PATH"
echo "$HOME/emsdk/upstream/emscripten" >> "$GITHUB_PATH"
- name: Build Firefox Add-on ZIP
run: |
set -euo pipefail
make package-unpackaged-assets
make firefox-addons
mkdir -p build/release/firefox-addons
cp build/dist/inbe-firefox-addons.zip build/release/firefox-addons/
- name: Upload Firefox Add-on Artifact
uses: actions/upload-artifact@v4
with:
name: release-firefox-addons
path: build/release/firefox-addons/*
if-no-files-found: error
build-linux:
name: Build Linux
runs-on: ubuntu-22.04
@@ -476,6 +539,7 @@ jobs:
needs:
- build-web
- build-chrome-extension
- build-firefox-addons
- build-linux
- build-freebsd
- build-windows
@@ -792,3 +856,55 @@ jobs:
print(json.dumps(response, indent=2), file=sys.stderr)
raise SystemExit("Chrome Web Store publish failed")
PY
publish-firefox-addons:
name: Publish Firefox Add-ons
runs-on: ubuntu-latest
needs:
- build-firefox-addons
- release
if: needs.release.outputs.tag_pushed == 'true'
steps:
- name: Check Firefox Add-ons Secrets
env:
AMO_JWT_ISSUER: ${{ secrets.AMO_JWT_ISSUER }}
AMO_JWT_SECRET: ${{ secrets.AMO_JWT_SECRET }}
run: |
set -euo pipefail
if [ -z "${AMO_JWT_ISSUER:-}" ]; then
echo "AMO_JWT_ISSUER secret is required to publish Firefox Add-ons"
exit 1
fi
if [ -z "${AMO_JWT_SECRET:-}" ]; then
echo "AMO_JWT_SECRET secret is required to publish Firefox Add-ons"
exit 1
fi
- name: Download Firefox Add-on Artifact
uses: actions/download-artifact@v4
with:
name: release-firefox-addons
path: build/release/firefox-addons
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '24'
- name: Publish Firefox Add-on
env:
AMO_JWT_ISSUER: ${{ secrets.AMO_JWT_ISSUER }}
AMO_JWT_SECRET: ${{ secrets.AMO_JWT_SECRET }}
FIREFOX_ADDON_ZIP: build/release/firefox-addons/inbe-firefox-addons.zip
run: |
set -euo pipefail
test -f "$FIREFOX_ADDON_ZIP"
mkdir -p build/firefox-addons/source build/firefox-addons/signed
unzip -q "$FIREFOX_ADDON_ZIP" -d build/firefox-addons/source
npx --yes web-ext sign \
--source-dir build/firefox-addons/source \
--artifacts-dir build/firefox-addons/signed \
--channel listed \
--api-key "$AMO_JWT_ISSUER" \
--api-secret "$AMO_JWT_SECRET"
+6
View File
@@ -1,4 +1,10 @@
# Changelog
## [1.8.6] - 2026-07-11
### Changed
- Added Firefox add-on packaging, release metadata updates, and CI/release automation.
- Improved web audio asset validation and Firefox/LibreWolf smoke testing.
- Fixed stale screen-local modal state so hidden modals cannot keep input captured after navigation.
## [1.8.5] - 2026-07-11
### Changed
- Updated Flint to improve file dialogs, cursor behavior, focus reset, icon slider popups, and shared raylib build locking.
+56 -7
View File
@@ -380,14 +380,24 @@ CHROME_WEB_STORE_ICONS := \
$(CHROME_WEB_STORE_ICON_DIR)/icon-32.png \
$(CHROME_WEB_STORE_ICON_DIR)/icon-48.png \
$(CHROME_WEB_STORE_ICON_DIR)/icon-128.png
FIREFOX_ADDONS_DIR := $(BUILD_DIST_DIR)/firefox-addons
FIREFOX_ADDONS_ZIP := $(BUILD_DIST_DIR)/$(APP_NAME)-firefox-addons.zip
FIREFOX_ADDONS_MANIFEST := packaging/firefox-addons/manifest.json
FIREFOX_ADDONS_BACKGROUND := packaging/firefox-addons/background.js
FIREFOX_ADDONS_ICON_DIR := $(CHROME_WEB_STORE_ICON_DIR)
FIREFOX_ADDONS_ICONS := $(CHROME_WEB_STORE_ICONS)
WEB_ASSET_FILES := $(shell find web-assets site-icons -type f 2>/dev/null)
UNPACKAGED_AUDIO_DIR := unpackaged_assets/audio
UNPACKAGED_AUDIO_FILES := $(shell find $(UNPACKAGED_AUDIO_DIR) -type f 2>/dev/null)
MEDITATION_AUDIO_ZIP := web-assets/dl/inbe-meditation-audio-v1.zip
MEDITATION_AUDIO_TRACKS := \
Elijah_K/deep-meditation.ogg \
Elijah_K/path-of-meditation.ogg \
Elijah_K/truth-of-silence.ogg
include $(FLINT_DIR)/mk/package-freebsd.mk
.PHONY: all native install install-user uninstall stage package-freebsd validate-desktop run run-fresh screenshot test dist appimage click click-verify vendor-prebuilds vendor-prebuilds-native vendor-prebuilds-web vendor-prebuilds-windows clean clean-linux clean-native clean-vendor-builds android-avd android-check-keystore android-copy-assets android-local-properties android-debug android-release android-bundle android-install android-install-release android-clean package-unpackaged-assets windows-runtime-assets-check windows windows64 windows32 web web-tools-check web-smoke-test site chrome-web-store
.PHONY: all native install install-user uninstall stage package-freebsd validate-desktop run run-fresh screenshot test dist appimage click click-verify vendor-prebuilds vendor-prebuilds-native vendor-prebuilds-web vendor-prebuilds-windows clean clean-linux clean-native clean-vendor-builds android-avd android-check-keystore android-copy-assets android-local-properties android-debug android-release android-bundle android-install android-install-release android-clean validate-meditation-audio package-unpackaged-assets windows-runtime-assets-check windows windows64 windows32 web web-tools-check web-smoke-test web-smoke-test-firefox web-smoke-test-librewolf site chrome-web-store firefox-addons
.NOTPARALLEL: dist windows windows64 windows32 android-release android-bundle click
all: native
@@ -411,6 +421,7 @@ dist:
$(MAKE) package-unpackaged-assets && \
$(MAKE) web && \
$(MAKE) chrome-web-store && \
$(MAKE) firefox-addons && \
$(MAKE) click && \
$(MAKE) appimage && \
$(MAKE) windows && \
@@ -540,7 +551,7 @@ $(APP_BOTTOM_NAV_TEST): tests/app_bottom_nav_test.c src/app/app_nav.c src/app/ap
-o $@ \
tests/app_bottom_nav_test.c
$(sort $(BUILD_OBJ_DIR) $(NATIVE_OBJ_DIR) $(NATIVE_BIN_DIR) $(NATIVE_DIST_DIR) $(LINUX_BIN_DIR) $(LINUX_DIST_DIR) $(LINUX_APPIMAGE_BUILD_DIR) $(CLICK_BIN_DIR) $(CLICK_BUILD_DIR) $(CLICK_DIST_DIR) $(WINDOWS_DIST_DIR) $(ANDROID_BUILD_DIR) $(TEST_BIN_DIR) $(WEB_OBJ_DIR) $(WEB_DIST_DIR) $(CHROME_WEB_STORE_DIR)):
$(sort $(BUILD_OBJ_DIR) $(NATIVE_OBJ_DIR) $(NATIVE_BIN_DIR) $(NATIVE_DIST_DIR) $(LINUX_BIN_DIR) $(LINUX_DIST_DIR) $(LINUX_APPIMAGE_BUILD_DIR) $(CLICK_BIN_DIR) $(CLICK_BUILD_DIR) $(CLICK_DIST_DIR) $(WINDOWS_DIST_DIR) $(ANDROID_BUILD_DIR) $(TEST_BIN_DIR) $(WEB_OBJ_DIR) $(WEB_DIST_DIR) $(CHROME_WEB_STORE_DIR) $(FIREFOX_ADDONS_DIR)):
mkdir -p $@
$(WINDOWS_BIN_DIR)/$(WIN64_ARCH) $(WINDOWS_BIN_DIR)/$(WIN32_ARCH):
@@ -946,12 +957,12 @@ $(WEB_JS_TARGET): Makefile $(WEB_SRC) $(FLINT_WEB_SRCS) $(FLINT_ICON_STAMP) $(SQ
-sSTACK_SIZE=33554432 \
-sGLOBAL_BASE=67108864 \
-sASYNCIFY_STACK_SIZE=1048576 \
-sEXPORTED_FUNCTIONS=_main,_malloc,_free,_app_web_get_play_in_background,_app_web_set_backgrounded,_app_web_background_tick \
-sEXPORTED_FUNCTIONS=_main,_malloc,_free,_app_web_get_play_in_background,_app_web_set_backgrounded,_app_web_background_tick,_app_web_launch_practice \
-lidbfs.js \
-lm
$(WEB_TARGET): src/web_shell.html $(WEB_BOOT_JS) $(WEB_JS_TARGET) manifest.json $(WEB_ASSET_FILES) $(MEDITATION_AUDIO_ZIP) | $(WEB_DIST_DIR)
perl -0pe 's#\{\{\{ SCRIPT \}\}\}#<script async src="index.js?v=$(WEB_CACHE_BUSTER)"></script>#g; s/WEB_CACHE_BUSTER/$(WEB_CACHE_BUSTER)/g' src/web_shell.html > $@
$(WEB_TARGET): src/web_shell.html $(WEB_BOOT_JS) $(WEB_JS_TARGET) manifest.json $(WEB_ASSET_FILES) $(MEDITATION_AUDIO_ZIP) validate-meditation-audio | $(WEB_DIST_DIR)
perl -0pe 's#\{\{\{ SCRIPT \}\}\}#<script>window.__inbeLoadApp("index.js?v=$(WEB_CACHE_BUSTER)")</script>#g; s/WEB_CACHE_BUSTER/$(WEB_CACHE_BUSTER)/g' src/web_shell.html > $@
cp $(WEB_BOOT_JS) $(WEB_DIST_DIR)/index_boot.js
perl -0pi -e 's/WEB_CACHE_BUSTER/$(WEB_CACHE_BUSTER)/g' $(WEB_DIST_DIR)/index_boot.js
rm -rf $(WEB_DIST_DIR)/web-assets $(WEB_DIST_DIR)/site-icons
@@ -1101,12 +1112,30 @@ android-clean:
$(GRADLE) -p droid clean $(ANDROID_GRADLE_ARGS)
rm -rf $(ANDROID_BUILD_DIR)
validate-meditation-audio:
@set -e; \
for file in $(MEDITATION_AUDIO_TRACKS); do \
path="$(UNPACKAGED_AUDIO_DIR)/$$file"; \
if [ ! -f "$$path" ]; then \
echo "Missing meditation audio track: $$path"; \
exit 1; \
fi; \
size=$$(wc -c < "$$path" | tr -d ' '); \
magic=$$(dd if="$$path" bs=4 count=1 2>/dev/null); \
if [ "$$magic" != "OggS" ] || [ "$$size" -lt 4096 ]; then \
echo "Invalid meditation audio track: $$path"; \
echo "Expected a real Ogg file. If this is a Git LFS pointer, run git lfs pull."; \
exit 1; \
fi; \
done
$(MEDITATION_AUDIO_ZIP): $(UNPACKAGED_AUDIO_FILES)
$(MAKE) validate-meditation-audio
mkdir -p $(dir $(MEDITATION_AUDIO_ZIP))
rm -f $(MEDITATION_AUDIO_ZIP)
cd $(UNPACKAGED_AUDIO_DIR) && find . -mindepth 2 -type f -name '*.ogg' -exec zip -9 -r $(abspath $(MEDITATION_AUDIO_ZIP)) {} + && zip -9 -r $(abspath $(MEDITATION_AUDIO_ZIP)) LICENSE.md MANIFEST.txt
cd $(UNPACKAGED_AUDIO_DIR) && zip -9 -r $(abspath $(MEDITATION_AUDIO_ZIP)) $(MEDITATION_AUDIO_TRACKS) LICENSE.md MANIFEST.txt
package-unpackaged-assets: $(MEDITATION_AUDIO_ZIP)
package-unpackaged-assets: validate-meditation-audio $(MEDITATION_AUDIO_ZIP)
windows-runtime-assets-check:
@:
@@ -1126,6 +1155,7 @@ windows:
$(WIN32_ARCH)/$(WIN32_BINARY_NAME)
web:
$(MAKE) validate-meditation-audio
$(MAKE) $(WEB_TARGET)
$(MAKE) web-smoke-test
rm -f $(WEB_DIST_ZIP)
@@ -1134,6 +1164,12 @@ web:
web-smoke-test: $(WEB_SMOKE_TEST)
WEB_SMOKE_BROWSER="$(WEB_SMOKE_BROWSER)" node $(WEB_SMOKE_TEST) $(WEB_DIST_DIR)
web-smoke-test-firefox: $(WEB_SMOKE_TEST)
WEB_SMOKE_BROWSER="firefox" node $(WEB_SMOKE_TEST) $(WEB_DIST_DIR)
web-smoke-test-librewolf: $(WEB_SMOKE_TEST)
WEB_SMOKE_BROWSER="librewolf" WEB_SMOKE_ALLOW_WEBGL_DISABLED=1 node $(WEB_SMOKE_TEST) $(WEB_DIST_DIR)
site: web
tclsh site/build.tcl
@@ -1150,6 +1186,19 @@ $(CHROME_WEB_STORE_ZIP): $(WEB_TARGET) $(CHROME_WEB_STORE_MANIFEST) $(CHROME_WEB
rm -f $(CHROME_WEB_STORE_ZIP)
cd $(CHROME_WEB_STORE_DIR) && zip -9 -r $(abspath $(CHROME_WEB_STORE_ZIP)) .
firefox-addons: $(FIREFOX_ADDONS_ZIP)
$(FIREFOX_ADDONS_ZIP): $(WEB_TARGET) $(FIREFOX_ADDONS_MANIFEST) $(FIREFOX_ADDONS_BACKGROUND) $(FIREFOX_ADDONS_ICONS) | $(FIREFOX_ADDONS_DIR)
rm -rf $(FIREFOX_ADDONS_DIR)
mkdir -p $(FIREFOX_ADDONS_DIR)/icons
cp -R $(WEB_DIST_DIR)/. $(FIREFOX_ADDONS_DIR)/
sed -e 's#__APP_VERSION__#$(APP_VERSION)#g' \
$(FIREFOX_ADDONS_MANIFEST) > $(FIREFOX_ADDONS_DIR)/manifest.json
cp $(FIREFOX_ADDONS_BACKGROUND) $(FIREFOX_ADDONS_DIR)/background.js
cp $(FIREFOX_ADDONS_ICONS) $(FIREFOX_ADDONS_DIR)/icons/
rm -f $(FIREFOX_ADDONS_ZIP)
cd $(FIREFOX_ADDONS_DIR) && zip -9 -r $(abspath $(FIREFOX_ADDONS_ZIP)) .
clean:
rm -rf build
+1
View File
@@ -139,6 +139,7 @@ Web:
make web
make site
make chrome-web-store
make firefox-addons
```
Linux:
+2 -2
View File
@@ -35,8 +35,8 @@ android {
defaultConfig {
minSdk 21
targetSdk 35
versionCode 80
versionName "1.8.5"
versionCode 81
versionName "1.8.6"
}
@@ -0,0 +1,5 @@
Changed
---
- Added Firefox add-on packaging, release metadata updates, and CI/release automation.
- Improved web audio asset validation and Firefox/LibreWolf smoke testing.
- Fixed stale screen-local modal state so hidden modals cannot keep input captured after navigation.
+3
View File
@@ -4,6 +4,9 @@
"short_name": "Inbe",
"version": "__APP_VERSION__",
"description": "Breathing, meditation, habit tracking, and encrypted sync.",
"permissions": [
"contextMenus"
],
"content_security_policy": {
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'"
},
+71 -2
View File
@@ -1,10 +1,79 @@
const appUrl = chrome.runtime.getURL("index.html");
const practiceUrls = {
whm: `${appUrl}?inbe_launch=start-practice&practice=whm`,
meditation: `${appUrl}?inbe_launch=start-practice&practice=meditation`,
sun_salutation: `${appUrl}?inbe_launch=start-practice&practice=sun_salutation`,
};
function openApp(url = appUrl) {
chrome.tabs.create({ url });
}
function createContextMenus(contexts) {
chrome.contextMenus.create({
id: "open",
title: "Open Inner Breeze",
contexts,
});
chrome.contextMenus.create({
id: "start-practice",
title: "Start Practice",
contexts,
});
chrome.contextMenus.create({
id: "start-whm",
parentId: "start-practice",
title: "Wim Hof",
contexts,
});
chrome.contextMenus.create({
id: "start-meditation",
parentId: "start-practice",
title: "Meditation",
contexts,
});
chrome.contextMenus.create({
id: "start-sun-salutation",
parentId: "start-practice",
title: "Sun Salutation",
contexts,
});
}
function rebuildContextMenus() {
chrome.contextMenus.removeAll(() => createContextMenus(["action"]));
}
chrome.action.onClicked.addListener(() => {
chrome.tabs.create({ url: appUrl });
openApp();
});
chrome.runtime.onInstalled.addListener((details) => {
rebuildContextMenus();
if (details.reason === "install")
chrome.tabs.create({ url: appUrl });
openApp();
});
chrome.runtime.onStartup.addListener(() => {
rebuildContextMenus();
});
chrome.contextMenus.onClicked.addListener((info) => {
switch (info.menuItemId) {
case "open":
openApp();
break;
case "start-whm":
openApp(practiceUrls.whm);
break;
case "start-meditation":
openApp(practiceUrls.meditation);
break;
case "start-sun-salutation":
openApp(practiceUrls.sun_salutation);
break;
default:
break;
}
});
+1 -1
View File
@@ -1,5 +1,5 @@
Package: inbe.waozi
Version: 1.8.5
Version: 1.8.6
Architecture: arm64
Maintainer: Waozi <[email protected]>
Click-Version: 0.4
+1 -1
View File
@@ -28,7 +28,7 @@
<binary>inbe</binary>
</provides>
<releases>
<release version="1.8.5" date="2026-07-11"/>
<release version="1.8.6" date="2026-07-11"/>
</releases>
<content_rating type="oars-1.1"/>
</component>
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "inbe",
"title": "Inner Breeze",
"version": "1.8.5",
"version": "1.8.6",
"architecture": "arm64",
"framework": "ubuntu-sdk-20.04",
"description": "Syncable breathing, meditation, and habit practice app.",
+85
View File
@@ -0,0 +1,85 @@
const extensionApi = globalThis.browser || globalThis.chrome;
const appUrl = extensionApi.runtime.getURL("index.html");
const practiceUrls = {
whm: `${appUrl}?inbe_launch=start-practice&practice=whm`,
meditation: `${appUrl}?inbe_launch=start-practice&practice=meditation`,
sun_salutation: `${appUrl}?inbe_launch=start-practice&practice=sun_salutation`,
};
function openApp(url = appUrl) {
extensionApi.tabs.create({ url });
}
function createContextMenus(contexts) {
extensionApi.contextMenus.create({
id: "open",
title: "Open Inner Breeze",
contexts,
});
extensionApi.contextMenus.create({
id: "start-practice",
title: "Start Practice",
contexts,
});
extensionApi.contextMenus.create({
id: "start-whm",
parentId: "start-practice",
title: "Wim Hof",
contexts,
});
extensionApi.contextMenus.create({
id: "start-meditation",
parentId: "start-practice",
title: "Meditation",
contexts,
});
extensionApi.contextMenus.create({
id: "start-sun-salutation",
parentId: "start-practice",
title: "Sun Salutation",
contexts,
});
}
function rebuildContextMenus() {
const removed = extensionApi.contextMenus.removeAll();
if (removed && typeof removed.then === "function")
removed.then(() => createContextMenus(["action"]));
else
createContextMenus(["action"]);
}
extensionApi.action.onClicked.addListener(() => {
openApp();
});
extensionApi.runtime.onInstalled.addListener((details) => {
rebuildContextMenus();
if (details.reason === "install")
openApp();
});
extensionApi.runtime.onStartup.addListener(() => {
rebuildContextMenus();
});
extensionApi.contextMenus.onClicked.addListener((info) => {
switch (info.menuItemId) {
case "open":
openApp();
break;
case "start-whm":
openApp(practiceUrls.whm);
break;
case "start-meditation":
openApp(practiceUrls.meditation);
break;
case "start-sun-salutation":
openApp(practiceUrls.sun_salutation);
break;
default:
break;
}
});
+36
View File
@@ -0,0 +1,36 @@
{
"manifest_version": 3,
"name": "Inner Breeze",
"short_name": "Inbe",
"version": "1.8.6",
"description": "Breathing, meditation, habit tracking, and encrypted sync.",
"permissions": [
"contextMenus"
],
"content_security_policy": {
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'"
},
"icons": {
"16": "icons/icon-16.png",
"32": "icons/icon-32.png",
"48": "icons/icon-48.png",
"128": "icons/icon-128.png"
},
"action": {
"default_title": "Open Inner Breeze",
"default_icon": {
"16": "icons/icon-16.png",
"32": "icons/icon-32.png",
"48": "icons/icon-48.png",
"128": "icons/icon-128.png"
}
},
"background": {
"scripts": ["background.js"]
},
"browser_specific_settings": {
"gecko": {
"id": "[email protected]"
}
}
}
+249 -46
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env node
import { createServer } from 'node:http';
import { createReadStream, mkdtempSync, rmSync, existsSync, accessSync, constants, readFileSync } from 'node:fs';
import { createReadStream, mkdtempSync, rmSync, existsSync, accessSync, constants, readFileSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join, normalize, resolve, sep } from 'node:path';
import { spawn } from 'node:child_process';
@@ -10,6 +10,9 @@ const root = resolve(process.argv[2] || 'build/dist/web');
const browserSetting = process.env.WEB_SMOKE_BROWSER || 'auto';
const browserArgs = (process.env.WEB_SMOKE_BROWSER_ARGS || '').split(/\s+/).filter(Boolean);
const timeoutMs = Number(process.env.WEB_SMOKE_TIMEOUT_MS || 30000);
const allowWebglDisabled = process.env.WEB_SMOKE_ALLOW_WEBGL_DISABLED
? !/^(0|false|no)$/i.test(process.env.WEB_SMOKE_ALLOW_WEBGL_DISABLED)
: false;
const useNoSandbox = process.env.WEB_SMOKE_NO_SANDBOX
? !/^(0|false|no)$/i.test(process.env.WEB_SMOKE_NO_SANDBOX)
: !!process.env.CI || (typeof process.getuid === 'function' && process.getuid() === 0);
@@ -69,7 +72,9 @@ function browserCandidates() {
'google-chrome-stable',
'chromium',
'chromium-browser',
'chrome'
'chrome',
'firefox',
'librewolf'
);
return [...new Set(candidates.filter(Boolean))];
}
@@ -89,6 +94,10 @@ function resolveBrowser() {
throw new Error(`no Chrome/Chromium browser found; tried ${tried.join(', ')}`);
}
function isFirefoxBrowser(browser) {
return /(^|[/\\])(firefox|librewolf)(\.exe)?$/i.test(browser);
}
function contentType(path) {
const dot = path.lastIndexOf('.');
return dot >= 0 ? mime.get(path.slice(dot).toLowerCase()) || 'application/octet-stream' : 'application/octet-stream';
@@ -223,6 +232,45 @@ function connect(wsUrl) {
});
}
function connectBidi(wsUrl) {
return new Promise((resolveConnect, reject) => {
const ws = new WebSocket(wsUrl);
const pending = new Map();
const events = [];
let nextId = 1;
ws.addEventListener('open', () => {
resolveConnect({
events,
send(method, params = {}) {
const id = nextId++;
ws.send(JSON.stringify({ id, method, params }));
return new Promise((resolveSend, rejectSend) => {
pending.set(id, { resolve: resolveSend, reject: rejectSend, method });
});
},
close() {
ws.close();
}
});
});
ws.addEventListener('message', event => {
const message = JSON.parse(event.data);
if (message.id && pending.has(message.id)) {
const item = pending.get(message.id);
pending.delete(message.id);
if (message.error)
item.reject(new Error(`${item.method}: ${message.message || message.error || JSON.stringify(message)}`));
else
item.resolve(message.result || {});
} else if (message.method) {
events.push(message);
}
});
ws.addEventListener('error', event => reject(new Error(event.message || `WebSocket error for ${wsUrl}`)));
});
}
function eventText(event) {
if (event.method === 'Runtime.consoleAPICalled') {
return (event.params.args || []).map(arg => arg.value ?? arg.description ?? '').join(' ');
@@ -255,6 +303,19 @@ function fatalEvent(event) {
return '';
}
function fatalBidiEvent(event) {
if (event.method !== 'log.entryAdded')
return '';
const params = event.params || {};
const text = params.text || params.args?.map(arg => arg.value ?? arg.text ?? '').join(' ') || '';
if (params.type === 'javascript' && params.level === 'error')
return text || 'javascript error';
if (params.level === 'error' && /Aborted|RuntimeError|unreachable|exception thrown/i.test(text))
return text;
return '';
}
async function waitForHealthyPage(client) {
const start = Date.now();
let sawRaylib = false;
@@ -275,9 +336,11 @@ async function waitForHealthyPage(client) {
const result = await client.send('Runtime.evaluate', {
expression: `(() => {
const canvas = document.querySelector('canvas');
if (!canvas) return { ok: false, reason: 'missing canvas' };
const status = document.querySelector('#status')?.textContent || '';
if (/WebGL is disabled/.test(status)) return { ok: ${allowWebglDisabled ? 'true' : 'false'}, disabledWebgl: true, status };
if (!canvas) return { ok: false, reason: 'missing canvas', status };
const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
if (!gl) return { ok: false, reason: 'missing webgl' };
if (!gl) return { ok: false, reason: 'missing webgl', status };
const width = gl.drawingBufferWidth;
const height = gl.drawingBufferHeight;
return {
@@ -306,6 +369,103 @@ async function waitForHealthyPage(client) {
throw new Error(`web app did not become healthy within ${timeoutMs}ms; state=${JSON.stringify(lastState)}; recent=${recent}`);
}
async function waitForHealthyBidiPage(client, context) {
const start = Date.now();
let lastState = null;
let healthySince = 0;
while (Date.now() - start < timeoutMs) {
for (const event of client.events) {
const fatal = fatalBidiEvent(event);
if (fatal)
throw new Error(fatal);
}
const result = await client.send('script.evaluate', {
target: { context },
awaitPromise: false,
resultOwnership: 'none',
expression: `JSON.stringify((() => {
const canvas = document.querySelector('canvas');
const status = document.querySelector('#status')?.textContent || '';
if (/WebGL is disabled/.test(status)) return { ok: ${allowWebglDisabled ? 'true' : 'false'}, disabledWebgl: true, status };
if (!canvas) return { ok: false, reason: 'missing canvas', status };
const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
if (!gl) return { ok: false, reason: 'missing webgl', status };
const width = gl.drawingBufferWidth;
const height = gl.drawingBufferHeight;
const boot = Array.from(document.querySelectorAll('script')).some(script => /index\\.js/.test(script.src || ''));
return { ok: width > 0 && height > 0 && boot, width, height };
})())`
});
try {
lastState = JSON.parse(result.result?.value || '{}');
} catch {
lastState = null;
}
if (lastState?.ok) {
if (!healthySince)
healthySince = Date.now();
if (Date.now() - healthySince >= 1500)
return lastState;
} else {
healthySince = 0;
}
await delay(250);
}
throw new Error(`Firefox web app did not become healthy within ${timeoutMs}ms; state=${JSON.stringify(lastState)}`);
}
async function waitForFirefoxBidi(browser, stderrLines) {
const start = Date.now();
let exited = false;
const onExit = () => {
exited = true;
};
browser.once('exit', onExit);
try {
while (Date.now() - start < timeoutMs) {
if (exited) {
const stderr = stderrLines.join('').trim();
throw new Error(`Firefox exited before BiDi was ready${stderr ? `; firefox stderr: ${stderr.slice(-4000)}` : ''}`);
}
const stderr = stderrLines.join('');
const match = stderr.match(/WebDriver BiDi listening on (ws:\/\/[^\s]+)/);
if (match)
return match[1].replace(/\/?$/, '/session');
await delay(50);
}
} finally {
browser.off('exit', onExit);
}
const stderr = stderrLines.join('').trim();
throw new Error(`timed out waiting for Firefox BiDi${stderr ? `; firefox stderr: ${stderr.slice(-4000)}` : ''}`);
}
function writeFirefoxPrefs() {
writeFileSync(join(userDataDir, 'user.js'), [
'user_pref("browser.shell.checkDefaultBrowser", false);',
'user_pref("browser.tabs.warnOnClose", false);',
'user_pref("browser.warnOnQuit", false);',
'user_pref("datareporting.policy.dataSubmissionEnabled", false);',
'user_pref("dom.webgpu.enabled", false);',
'user_pref("gfx.webrender.software", true);',
'user_pref("media.autoplay.default", 0);',
'user_pref("privacy.fingerprintingProtection", false);',
'user_pref("privacy.resistFingerprinting", false);',
'user_pref("webgl.disabled", false);',
'user_pref("webgl.disable-fail-if-major-performance-caveat", false);',
'user_pref("webgl.enable-webgl2", true);',
'user_pref("webgl.force-enabled", true);',
''
].join('\n'));
}
async function waitForStorageIdle(client) {
const start = Date.now();
let lastState = null;
@@ -366,50 +526,93 @@ let failure;
try {
const port = await listen();
const browser = resolveBrowser();
const args = [
'--headless=new',
'--remote-debugging-port=0',
'--remote-debugging-address=127.0.0.1',
`--user-data-dir=${userDataDir}`,
'--no-first-run',
'--no-default-browser-check',
'--disable-background-networking',
'--disable-dev-shm-usage',
'--enable-unsafe-swiftshader',
'--ignore-gpu-blocklist',
'--enable-webgl',
'--use-gl=angle',
'--use-angle=swiftshader',
...browserArgs,
'about:blank'
];
if (useNoSandbox)
args.splice(1, 0, '--no-sandbox');
if (isFirefoxBrowser(browser)) {
writeFirefoxPrefs();
const args = [
'--headless',
'--new-instance',
'--profile',
userDataDir,
'--remote-debugging-port',
'0',
'--remote-allow-hosts',
'127.0.0.1',
'--remote-allow-origins',
'*',
...browserArgs,
'about:blank'
];
const firefoxStderr = [];
chrome = spawn(browser, args, { stdio: ['ignore', 'ignore', 'pipe'], detached: true });
chrome.stderr.setEncoding('utf8');
chrome.stderr.on('data', chunk => {
firefoxStderr.push(chunk);
while (firefoxStderr.join('').length > 8000)
firefoxStderr.shift();
});
chrome.once('error', error => {
if (!failure)
failure = error;
});
const chromeStderr = [];
chrome = spawn(browser, args, { stdio: ['ignore', 'ignore', 'pipe'], detached: true });
chrome.stderr.setEncoding('utf8');
chrome.stderr.on('data', chunk => {
chromeStderr.push(chunk);
while (chromeStderr.join('').length > 8000)
chromeStderr.shift();
});
chrome.once('error', error => {
if (!failure)
failure = error;
});
const bidiUrl = await waitForFirefoxBidi(chrome, firefoxStderr);
client = await connectBidi(bidiUrl);
await client.send('session.new', { capabilities: {} });
await client.send('session.subscribe', { events: ['log.entryAdded'] });
const created = await client.send('browsingContext.create', { type: 'tab' });
const context = created.context;
await client.send('browsingContext.navigate', {
context,
url: `http://127.0.0.1:${port}/index.html`,
wait: 'complete'
});
await waitForHealthyBidiPage(client, context);
} else {
const args = [
'--headless=new',
'--remote-debugging-port=0',
'--remote-debugging-address=127.0.0.1',
`--user-data-dir=${userDataDir}`,
'--no-first-run',
'--no-default-browser-check',
'--disable-background-networking',
'--disable-dev-shm-usage',
'--enable-unsafe-swiftshader',
'--ignore-gpu-blocklist',
'--enable-webgl',
'--use-gl=angle',
'--use-angle=swiftshader',
...browserArgs,
'about:blank'
];
if (useNoSandbox)
args.splice(1, 0, '--no-sandbox');
const devtoolsPort = await waitForDevtools(chrome, chromeStderr);
const pages = await jsonRequest(`http://127.0.0.1:${devtoolsPort}/json/new?about:blank`, {
method: 'PUT'
});
client = await connect(pages.webSocketDebuggerUrl);
await client.send('Runtime.enable');
await client.send('Log.enable');
await client.send('Page.enable');
await client.send('Page.navigate', { url: `http://127.0.0.1:${port}/index.html` });
await waitForHealthyPage(client);
await verifyReloadPersistence(client);
const chromeStderr = [];
chrome = spawn(browser, args, { stdio: ['ignore', 'ignore', 'pipe'], detached: true });
chrome.stderr.setEncoding('utf8');
chrome.stderr.on('data', chunk => {
chromeStderr.push(chunk);
while (chromeStderr.join('').length > 8000)
chromeStderr.shift();
});
chrome.once('error', error => {
if (!failure)
failure = error;
});
const devtoolsPort = await waitForDevtools(chrome, chromeStderr);
const pages = await jsonRequest(`http://127.0.0.1:${devtoolsPort}/json/new?about:blank`, {
method: 'PUT'
});
client = await connect(pages.webSocketDebuggerUrl);
await client.send('Runtime.enable');
await client.send('Log.enable');
await client.send('Page.enable');
await client.send('Page.navigate', { url: `http://127.0.0.1:${port}/index.html` });
await waitForHealthyPage(client);
await verifyReloadPersistence(client);
}
console.log('web smoke: PASS');
} catch (error) {
failure = error;
+67 -3
View File
@@ -465,6 +465,16 @@ app_open_modal(InbeApp *app, UIModalType type)
app->modal_input_block_frame = app->inbe.frame;
}
static void
app_clear_modal_state(InbeApp *app)
{
if(app == NULL)
return;
app->modal.active = 0;
app->modal.type = UIModalNone;
app->modal_input_block_frame = app->inbe.frame;
}
void
app_close_modal(InbeApp *app)
{
@@ -489,9 +499,41 @@ app_close_modal(InbeApp *app)
app->tutorial_step = 0;
app->practice_tab = PRACTICE_TAB_PLAY;
}
app->modal.active = 0;
app->modal.type = UIModalNone;
app->modal_input_block_frame = app->inbe.frame;
app_clear_modal_state(app);
}
static int
app_screen_local_modal_valid(const InbeApp *app, UIModalType type)
{
if(app == NULL)
return 0;
switch(type) {
case UIModalConfirmExitSession:
return app->inbe.screen == InbeScreenSession ||
app->inbe.screen == InbeScreenMeditation ||
app->inbe.screen == InbeScreenSunSalutation;
case UIModalMeditationSetup:
return app->inbe.screen == InbeScreenStart;
case UIModalConfirmDeleteHabit:
case UIModalHabitPracticeListInfo:
case UIModalHabitCountingInfo:
return app->inbe.screen == InbeScreenHabitEdit;
case UIModalBottomNavConfig:
return app->inbe.screen == InbeScreenCustomizeNav;
default:
return 1;
}
}
static void
app_clear_invalid_screen_local_modal(InbeApp *app)
{
if(app == NULL || !app->modal.active)
return;
if(app_screen_local_modal_valid(app, app->modal.type))
return;
app_clear_modal_state(app);
}
void
@@ -1222,6 +1264,27 @@ app_web_background_tick(int elapsed_ms)
app->backgrounded = 1;
practice_active_advance_elapsed(app, elapsed_ms);
}
EMSCRIPTEN_KEEPALIVE
void
app_web_launch_practice(int practice_id)
{
InbeApp *app = get_global_inbe_app();
const PracticeDefinition *practice;
if(app == NULL)
return;
app->exercise_type = practice_clamp_id(practice_id);
app->main_tab = APP_MAIN_TAB_PRACTICE;
app->practice_tab = PRACTICE_TAB_PLAY;
if(app->modal.active)
app_close_modal(app);
practice = practice_get(app->exercise_type);
if(practice->start != NULL)
practice->start(app);
}
#endif
static void
@@ -1500,6 +1563,7 @@ updateapp(InbeApp *app)
habits_screen_prepare_first_run_guide(app);
first_run_guide_active = practice_screen_first_run_guide_active(app);
habits_guide_active = habits_screen_first_run_guide_active(app);
app_clear_invalid_screen_local_modal(app);
practice_fullscreen_modal =
app->modal.active &&
app->modal.type == UIModalEditProgressiveStartSpeed;
+2 -2
View File
@@ -3,7 +3,7 @@
#define INBE_VERSION_MAJOR 1
#define INBE_VERSION_MINOR 8
#define INBE_VERSION_PATCH 5
#define INBE_VERSION_STRING "1.8.5"
#define INBE_VERSION_PATCH 6
#define INBE_VERSION_STRING "1.8.6"
#endif
+40 -4
View File
@@ -81,6 +81,27 @@ file_exists(const char *path)
return 1;
}
static int
audio_file_looks_valid(const char *path)
{
FILE *file;
unsigned char magic[4];
size_t got;
if(path == NULL || path[0] == '\0')
return 0;
file = fopen(path, "rb");
if(file == NULL)
return 0;
got = fread(magic, 1, sizeof(magic), file);
fclose(file);
return got == sizeof(magic) &&
magic[0] == 'O' && magic[1] == 'g' &&
magic[2] == 'g' && magic[3] == 'S';
}
static int
safe_archive_member(const char *path)
{
@@ -375,11 +396,21 @@ extract_audio_archive(InbeApp *app, const char *archive_path)
EnsureRuntimeAssetDir(dir);
}
}
if(mz_zip_reader_extract_to_file(&archive, i, out_path, 0))
extracted++;
if(mz_zip_reader_extract_to_file(&archive, i, out_path, 0)) {
if(audio_file_looks_valid(out_path))
extracted++;
else
remove(out_path);
}
}
mz_zip_reader_end(&archive);
if(extracted != MEDITATION_MUSIC_TRACK_COUNT) {
snprintf(app->meditation.music_status, sizeof(app->meditation.music_status),
"Audio archive did not contain usable audio");
return 0;
}
snprintf(app->meditation.music_status, sizeof(app->meditation.music_status),
"Installed %d audio files", extracted);
#if defined(PLATFORM_WEB)
@@ -393,7 +424,7 @@ extract_audio_archive(InbeApp *app, const char *archive_path)
});
}
#endif
return extracted > 0;
return 1;
}
int
@@ -610,7 +641,12 @@ meditation_music_update(InbeApp *app)
!app->meditation.music_archive_extracted) {
music_archive_path(app, archive_path, sizeof(archive_path));
app->meditation.music_archive_extracted = 1;
extract_audio_archive(app, archive_path);
if(!extract_audio_archive(app, archive_path)) {
snprintf(app->meditation.music_download.error,
sizeof(app->meditation.music_download.error),
"%s", app->meditation.music_status);
app->meditation.music_download.status = RUNTIME_ASSET_ERROR;
}
} else if(app->meditation.music_download.status == RUNTIME_ASSET_ERROR) {
if(is_network_download_error(&app->meditation.music_download)) {
set_status(app, GetLocaleText("meditation_music_network_error_title"));
+57
View File
@@ -2,6 +2,37 @@ var statusElement = document.querySelector('#status');
var progressElement = document.querySelector('#progress');
var loadingScreen = document.querySelector('#loading-screen');
function webglAvailable() {
var canvas;
var gl;
try {
canvas = document.createElement('canvas');
gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
} catch (e) {
gl = null;
}
return !!gl;
}
window.__inbeLoadApp = function(src) {
var script;
if (!webglAvailable()) {
if (statusElement) {
statusElement.textContent = 'WebGL is disabled. Enable WebGL in this browser to run Inner Breeze.';
}
if (progressElement) progressElement.hidden = true;
console.error('INBE: WebGL is disabled or unavailable');
return;
}
script = document.createElement('script');
script.async = true;
script.src = src;
document.body.appendChild(script);
};
function hideLoadingScreen() {
if (!loadingScreen) return;
window.requestAnimationFrame(function() {
@@ -100,6 +131,7 @@ var Module = {
postRun: [function() {
Module.__inbeRuntimeReady = true;
hideLoadingScreen();
runLaunchCommand();
}],
locateFile: function(path, prefix) {
if (path === 'index.wasm' || path === 'index.data') {
@@ -175,6 +207,31 @@ var Module = {
};
globalThis.Module = Module;
function launchPracticeId(value) {
switch (value) {
case 'whm':
return 0;
case 'meditation':
return 1;
case 'sun_salutation':
return 2;
default:
return -1;
}
}
function runLaunchCommand() {
var params = new URLSearchParams(window.location.search || '');
var launch = params.get('inbe_launch');
var practice = params.get('practice');
var practiceId;
if (launch !== 'start-practice') return;
practiceId = launchPracticeId(practice);
if (practiceId < 0 || typeof Module._app_web_launch_practice !== 'function') return;
Module._app_web_launch_practice(practiceId);
}
Module.setStatus('Downloading...');
window.onerror = function() {
Module.setStatus('Exception thrown, see JavaScript console');
+8
View File
@@ -11,6 +11,7 @@ CHANGELOG_DIR="fastlane/metadata/android/en-US/changelogs"
CLICK_MANIFEST_FILE="packaging/click/manifest.json"
CLICK_CONTROL_FILE="packaging/click/control"
CLICK_METAINFO_FILE="packaging/click/inbe.metainfo.xml"
FIREFOX_ADDONS_MANIFEST_FILE="packaging/firefox-addons/manifest.json"
replace_in_file() {
local expr="$1"
@@ -105,6 +106,13 @@ else
echo "Warning: $CLICK_METAINFO_FILE not found"
fi
if [ -f "$FIREFOX_ADDONS_MANIFEST_FILE" ]; then
replace_in_file "s/^\([[:space:]]*\"version\": \)\"[^\"]*\"/\1\"$LATEST_VERSION\"/" "$FIREFOX_ADDONS_MANIFEST_FILE"
echo "✓ Updated $FIREFOX_ADDONS_MANIFEST_FILE"
else
echo "Warning: $FIREFOX_ADDONS_MANIFEST_FILE not found"
fi
# Create changelog directory
mkdir -p "$CHANGELOG_DIR"
+4 -4
View File
@@ -3,8 +3,8 @@
IDI_APP_ICON ICON "inbe.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,8,5,0
PRODUCTVERSION 1,8,5,0
FILEVERSION 1,8,6,0
PRODUCTVERSION 1,8,6,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -21,11 +21,11 @@ BEGIN
BEGIN
VALUE "CompanyName", "waozi"
VALUE "FileDescription", "Inner Breeze"
VALUE "FileVersion", "1.8.5"
VALUE "FileVersion", "1.8.6"
VALUE "InternalName", "inbe"
VALUE "OriginalFilename", "inbe-windows-x86_64.exe"
VALUE "ProductName", "Inner Breeze"
VALUE "ProductVersion", "1.8.5"
VALUE "ProductVersion", "1.8.6"
END
END
BLOCK "VarFileInfo"