← Commit history

ffpup v0.1.1: snap-Firefox profile fix

barrett-land ·d23071320b ·4mo ago ·parent 7427cfa
5 files changed +24−8
bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "ffpup",   "displayName": "ffpup (Firefox / WebDriver BiDi)",-  "version": "0.1.0",+  "version": "0.1.1",   "description": "Firefox browser automation, the BiDi sibling of the puppeteer (Chrome) bridge. Drives the user's REAL Firefox over WebDriver BiDi — trusted input (isTrusted=true), persistent logged-in profiles, and NO 'controlled by automation' infobar. Mirrors the pup verb surface under the ffbrowser_ prefix. Uses the system Firefox (no browser download).",   "homepage": "https://github.com/adom-inc/adom-desktop",   "author": "Adom Inc.",
ffpup-bridge-v0.1.1.zipadded
⋯ 1 unchanged line ⋯
ffpup-manifest.json+5−5
@@ -1,8 +1,8 @@ {   "manifest_version": 1,-  "version": "0.1.0",-  "url": "ffpup-bridge-v0.1.0.zip",-  "sha256": "2cb6750c594450f778828a3723c05e678fb5292df284ec4713a5672b72e97a29",-  "size": 6617,-  "released_at": "2026-06-29T16:53:57Z"+  "version": "0.1.1",+  "url": "ffpup-bridge-v0.1.1.zip",+  "sha256": "ff5de351d9b79f5aaad7cc7825cc2af971b04e8b16366369764f88b21b3eabec",+  "size": 6922,+  "released_at": "2026-06-29T17:00:00Z" }\ No newline at end of file
package.json+1−1
@@ -1,6 +1,6 @@ {   "name": "adom-ffpup-bridge",-  "version": "0.1.0",+  "version": "0.1.1",   "description": "ffpup — Firefox (WebDriver BiDi) bridge for Adom Desktop. Sibling of the puppeteer (Chrome) bridge.",   "main": "server.js",   "scripts": {
server.js+17−1
@@ -44,7 +44,23 @@ const PORT = (() => { // container/CI testing where there's no display. const HEADLESS = process.env.FFPUP_HEADLESS === '1'; -const STATE_DIR = path.join(__dirname, '.ffpup');+// Firefox profile location. Snap-packaged Firefox (the Ubuntu 24.04 default) is+// confined: it can ONLY read profiles under ~/snap/firefox/… or NON-hidden home+// dirs — NOT ~/.local, where AD's bridges-cache lives. A profile it can't read+// gives the user a "profile could not be loaded" dialog and Firefox exits. So when+// snap Firefox is present, put profiles inside its own accessible data dir.+function resolveStateDir() {+  if (process.env.FFPUP_STATE_DIR) return process.env.FFPUP_STATE_DIR;+  const home = process.env.HOME || require('os').homedir();+  if (process.platform === 'linux') {+    try {+      const snapCommon = path.join(home, 'snap', 'firefox', 'common');+      if (fs.existsSync(snapCommon)) return path.join(snapCommon, 'ffpup');+    } catch { /* ignore */ }+  }+  return path.join(__dirname, '.ffpup');+}+const STATE_DIR = resolveStateDir(); const PROFILES_DIR = path.join(STATE_DIR, 'profiles'); fs.mkdirSync(PROFILES_DIR, { recursive: true });