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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ body:
attributes:
label: raw version
description: The `raw status` output or `package.json` version.
placeholder: "0.5.1"
placeholder: "0.7.0"
validations:
required: true
- type: input
Expand Down
62 changes: 61 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ci

on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

permissions:
contents: read
Expand Down Expand Up @@ -70,6 +70,66 @@ jobs:
- run: dotnet build edge-bridge/host/RawEdgeBridge.csproj -c Release --nologo
- run: node scripts/smoke-bridge.mjs

bridge-host-posix:
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24.x
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: publish the single-file host
shell: bash
run: |
RID=$(node -p "process.platform === 'darwin' ? (process.arch === 'arm64' ? 'osx-arm64' : 'osx-x64') : 'linux-x64'")
dotnet publish edge-bridge/host/RawEdgeBridge.csproj -c Release -r "$RID" \
--self-contained true -p:PublishSingleFile=true \
-p:IncludeNativeLibrariesForSelfExtract=true \
-p:EnableCompressionInSingleFile=true -o host-out --nologo
chmod +x host-out/raw-edge-bridge
test -x host-out/raw-edge-bridge
- name: smoke the native host
shell: bash
env:
RAW_BRIDGE_HOST: ${{ github.workspace }}/host-out/raw-edge-bridge
run: node scripts/smoke-bridge.mjs
- name: install into a disposable home
shell: bash
run: |
node scripts/install-edge-bridge.mjs --browser both \
--host-path "$PWD/host-out/raw-edge-bridge" --home "$RUNNER_TEMP/raw-home"
node - <<'NODE'
const fs = require("node:fs");
const path = require("node:path");
const home = path.join(process.env.RUNNER_TEMP, "raw-home");
const raw = path.join(home, ".raw");
for (const file of ["edge-bridge.json", "chrome-bridge.json"]) {
if (!fs.existsSync(path.join(raw, file))) throw new Error(`missing ${file}`);
}
const manifestRoot = path.join(raw, "edge-bridge");
for (const file of ["com.raw.edge_bridge.edge.json", "com.raw.edge_bridge.chrome.json"]) {
const manifest = JSON.parse(fs.readFileSync(path.join(manifestRoot, file), "utf8"));
if (manifest.type !== "stdio" || !manifest.allowed_origins[0].startsWith("chrome-extension://")) {
throw new Error(`bad manifest ${file}`);
}
}
const browserDir = process.platform === "darwin"
? path.join(home, "Library", "Application Support", "Google", "Chrome", "NativeMessagingHosts")
: path.join(home, ".config", "google-chrome", "NativeMessagingHosts");
if (!fs.existsSync(path.join(browserDir, "com.raw.edge_bridge.json"))) {
throw new Error("chrome native-messaging manifest was not registered");
}
const host = path.join(raw, "edge-bridge", "current", "raw-edge-bridge");
if (!(fs.statSync(host).mode & 0o111)) throw new Error("installed host is not executable");
NODE

dependency-audit:
timeout-minutes: 5
runs-on: ubuntu-latest
Expand Down
133 changes: 106 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ concurrency:
cancel-in-progress: false

jobs:
release:
runs-on: windows-latest
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

Expand All @@ -22,54 +22,133 @@ jobs:
node-version: 24.x
cache: npm

- uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- run: npm ci
- run: node scripts/check-versions.mjs --tag ${{ github.ref_name }}
- run: npm run typecheck
- run: npm test
- run: npm run build
- run: node scripts/smoke-browser.mjs

host-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- name: publish the self-contained bridge host
- name: publish the self-contained Windows host
shell: pwsh
run: |
dotnet publish edge-bridge/host/RawEdgeBridge.csproj -c Release -r win-x64 `
--self-contained true -p:PublishSingleFile=true `
-p:IncludeNativeLibrariesForSelfExtract=true `
-p:EnableCompressionInSingleFile=true -o host-out --nologo

- name: pack the host and checksums
shell: pwsh
run: |
New-Item -ItemType Directory -Path host-pack -Force | Out-Null
Copy-Item host-out/raw-edge-bridge.exe host-pack/raw-edge-bridge.exe -Force
Compress-Archive -Path host-pack/raw-edge-bridge.exe -DestinationPath raw-bridge-host-win-x64.zip -Force
$hash = (Get-FileHash raw-bridge-host-win-x64.zip -Algorithm SHA256).Hash.ToLowerInvariant()
"$hash raw-bridge-host-win-x64.zip" | Set-Content SHA256SUMS.txt -Encoding ascii

- name: pack the npm tarball
run: npm pack
- uses: actions/upload-artifact@v4
with:
name: host-win-x64
path: raw-bridge-host-win-x64.zip

- name: add a stable tarball name
shell: pwsh
host-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- name: publish the self-contained Linux hosts
shell: bash
run: |
for rid in linux-x64 linux-arm64; do
dotnet publish edge-bridge/host/RawEdgeBridge.csproj -c Release -r "$rid" \
--self-contained true -p:PublishSingleFile=true \
-p:IncludeNativeLibrariesForSelfExtract=true \
-p:EnableCompressionInSingleFile=true -o "host-out/$rid" --nologo
mkdir -p "host-pack/$rid"
cp "host-out/$rid/raw-edge-bridge" "host-pack/$rid/"
chmod +x "host-pack/$rid/raw-edge-bridge"
tar -czf "raw-bridge-host-$rid.tar.gz" -C "host-pack/$rid" raw-edge-bridge
test -s "raw-bridge-host-$rid.tar.gz"
done

- uses: actions/upload-artifact@v4
with:
name: host-linux
path: raw-bridge-host-linux-*.tar.gz

host-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- name: publish the self-contained macOS hosts
shell: bash
run: |
$tarball = (Get-ChildItem *.tgz | Select-Object -First 1).Name
Copy-Item $tarball raw-browser.tgz -Force
for rid in osx-x64 osx-arm64; do
dotnet publish edge-bridge/host/RawEdgeBridge.csproj -c Release -r "$rid" \
--self-contained true -p:PublishSingleFile=true \
-p:IncludeNativeLibrariesForSelfExtract=true \
-p:EnableCompressionInSingleFile=true -o "host-out/$rid" --nologo
mkdir -p "host-pack/$rid"
cp "host-out/$rid/raw-edge-bridge" "host-pack/$rid/"
chmod +x "host-pack/$rid/raw-edge-bridge"
tar -czf "raw-bridge-host-$rid.tar.gz" -C "host-pack/$rid" raw-edge-bridge
test -s "raw-bridge-host-$rid.tar.gz"
done

- uses: actions/upload-artifact@v4
with:
name: host-macos
path: raw-bridge-host-osx-*.tar.gz

release:
needs: [verify, host-windows, host-linux, host-macos]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 24.x
cache: npm

- run: npm ci

- uses: actions/download-artifact@v4
with:
path: release-assets
merge-multiple: true

- name: checksums for every host archive
run: |
cd release-assets
sha256sum raw-bridge-host-* > SHA256SUMS.txt
cat SHA256SUMS.txt

- name: pack the npm tarball
run: |
npm pack
tarball=$(ls raw-browser-*.tgz | head -1)
cp "$tarball" raw-browser.tgz

- name: create the release and upload assets
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
run: |
$tag = "${{ github.ref_name }}"
gh release view $tag 2>$null
if ($LASTEXITCODE -ne 0) {
gh release create $tag --title "raw-browser $tag" --generate-notes
}
$tarball = (Get-ChildItem *.tgz | Select-Object -First 1).Name
gh release upload $tag raw-bridge-host-win-x64.zip SHA256SUMS.txt $tarball raw-browser.tgz --clobber
tag="${{ github.ref_name }}"
gh release view "$tag" >/dev/null 2>&1 || gh release create "$tag" --title "raw-browser $tag" --generate-notes
gh release upload "$tag" release-assets/*.zip release-assets/*.tar.gz release-assets/SHA256SUMS.txt raw-browser.tgz --clobber

npm:
needs: release
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ demo/.frames/
host-out/
host-pack/
raw-bridge-host-win-x64.zip
raw-bridge-host-*.zip
raw-bridge-host-*.tar.gz
SHA256SUMS.txt
33 changes: 32 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,35 @@
All notable changes to `raw` are documented here. The format follows Keep a Changelog and versions
follow Semantic Versioning.

## [0.7.0] - 2026-10-23

### Added

- The extension bridge now installs on macOS and Linux. A cross-platform
`scripts/install-edge-bridge.mjs` handles the native-messaging host,
`~/.raw/edge-bridge.json` / `~/.raw/chrome-bridge.json`, and the browser
manifests under `~/Library/Application Support` (macOS) or `~/.config`
(Linux). On Windows it delegates to the existing PowerShell installer, so
one command works everywhere.
- Release builds now publish self-contained hosts for `linux-x64`,
`linux-arm64`, `osx-x64` and `osx-arm64` alongside `win-x64`, plus a single
`SHA256SUMS.txt` covering every archive.
- CI runs the native-host smoke test on Ubuntu, macOS and Windows, plus a real
installer pass on Ubuntu and macOS.

### Changed

- Browser discovery also finds Chrome Beta/Canary, Chromium and Edge
Beta/Dev/Canary, plus Linux packages under `/opt` and snap Chromium, so
macOS/Linux users are less likely to need `RAW_BROWSER_PATH`.
- README, README.zh-CN and `edge-bridge/README.md` document the cross-platform
install, the per-OS native-messaging directories, and the WSL/snap caveats.

### Fixed

- The native host treats process enumeration as best-effort, so a restricted
`Process.GetProcessesByName` call on macOS or Linux cannot prevent startup.

## [0.6.2] - 2026-10-23

### Added
Expand Down Expand Up @@ -203,7 +232,9 @@ follow Semantic Versioning.
- Strict TypeScript checking, a locked development toolchain, and full CLI protocol, setup, and permission smoke tests now gate publication.
- Browser smoke testing uses a disposable profile and covers forms, iframes, downloads, screenshots, isolated spaces, cleanup, and CPU timeouts.

[Unreleased]: https://github.com/liutingqiu/raw-browser/compare/v0.6.1...HEAD
[Unreleased]: https://github.com/liutingqiu/raw-browser/compare/v0.7.0...HEAD
[0.7.0]: https://github.com/liutingqiu/raw-browser/releases/tag/v0.7.0
[0.6.2]: https://github.com/liutingqiu/raw-browser/releases/tag/v0.6.2
[0.6.1]: https://github.com/liutingqiu/raw-browser/releases/tag/v0.6.1
[0.6.0]: https://github.com/liutingqiu/raw-browser/releases/tag/v0.6.0
[0.5.1]: https://github.com/liutingqiu/raw-browser/releases/tag/v0.5.1
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Run `npm run smoke:browser` when changing browser automation. It opens the
dedicated local browser profile and verifies same-origin iframe interaction,
downloads, screenshots and CPU-timeout termination.

Run `npm run smoke:bridge` on Windows (with the .NET 9 SDK) when changing the
native host or the extension. It builds the host and exercises the bridge
protocol.
Run `npm run smoke:bridge` on Windows, macOS or Linux (with the .NET 9 SDK)
when changing the native host or the extension. It builds the host and
exercises the bridge protocol.

Add focused `node:test` coverage for protocol serialization, context boundaries,
permissions, and filesystem behavior. Keep generated files out of commits;
Expand Down
Loading
Loading