Skip to content

feat(build): bundle Bear Spaces + Bear Containers into overlay — ship by default - #146

Merged
mdheller merged 1 commit into
mainfrom
feat/extension-bundle-overlay
Aug 4, 2026
Merged

feat(build): bundle Bear Spaces + Bear Containers into overlay — ship by default#146
mdheller merged 1 commit into
mainfrom
feat/extension-bundle-overlay

Conversation

@mdheller

@mdheller mdheller commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

The two BearBrowser extensions (Bear Spaces, Bear Containers) were written but not bundled — users had to manually load them via about:debugging. This PR wires them into the overlay build so they're force-installed on first launch.

How it works

Step 1 — Pack (bearbrowser-pack-extensions.sh):

  • Reads browser_specific_settings.gecko.id from each extensions/*/manifest.json
  • Zips contents → build/extensions/<gecko-id>.xpi

Step 2 — Install (bearbrowser-install-extensions.sh):

  • Copies .xpi files into BearBrowser.app/Contents/Resources/distribution/extensions/
  • Merges policies.json (preserving existing policies):
    {
      "policies": {
        "Extensions": {
          "Install": ["file:///...bear-spaces@bearbrowser.local.xpi", "..."]
        },
        "ExtensionSettings": {
          "bear-spaces@bearbrowser.local": { "installation_mode": "force_installed" },
          "bear-containers@bearbrowser.local": { "installation_mode": "force_installed" }
        }
      }
    }

Overlay build (bearbrowser-overlay-binary.sh):

  • New step 7 of 10: pack → install, after branding patches but before xattr-strip and ad-hoc signing
  • Extensions are covered by the final signature

Files

File Role
scripts/bearbrowser-pack-extensions.sh Zip each extension → .xpi
scripts/bearbrowser-install-extensions.sh Copy .xpi + write policies.json
scripts/bearbrowser-overlay-binary.sh +step 7, renumbered 7→8→9→10
extensions/README.md Developer docs: what each extension does, how to load for dev, build pipeline

Test plan

  • ./scripts/bearbrowser-pack-extensions.sh — produces build/extensions/bear-spaces@bearbrowser.local.xpi and bear-containers@mdheller.xpi
  • ./scripts/bearbrowser-install-extensions.sh /Applications/BearBrowser.app — XPIs copied, policies.json contains both force_installed entries
  • Full overlay build (./scripts/bearbrowser-overlay-binary.sh) completes step 7 without error
  • Launch BearBrowser — both extensions installed, no manual load required
  • Existing policies.json entries (if any) not overwritten

bearbrowser-pack-extensions.sh (new):
- Loops extensions/*/; reads gecko ID from manifest.json
- Zips contents → build/extensions/<gecko-id>.xpi (portable output path)

bearbrowser-install-extensions.sh (new):
- Copies .xpi files into BearBrowser.app/Contents/Resources/distribution/extensions/
- Merges policies.json: Extensions.Install + ExtensionSettings force_installed
- Preserves existing policies (wildcard block, etc.) via Python merge

bearbrowser-overlay-binary.sh (modified):
- New step 7 (of 10): pack → install extensions before xattr-strip + signing
- Extensions land inside the bundle and are covered by the ad-hoc signature
- Renumbered existing steps 7→8, 8→9, 9→10

extensions/README.md (new):
- Bear Spaces + Bear Containers feature docs
- Dev load instructions (about:debugging)
- Overlay build pipeline explanation
@mdheller
mdheller merged commit 638253c into main Aug 4, 2026
17 checks passed
@mdheller
mdheller deleted the feat/extension-bundle-overlay branch August 4, 2026 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant