fix(cdp): emit canAccessOpener in all TargetInfo payloads, add aarch64 cross-compile CI

Merges PR #165 and PR #172.

PR #165: The CDP spec marks canAccessOpener as a required boolean on
TargetInfo but Obscura was omitting it. Strict Rust clients like
chromiumoxide reject the event entirely and panic with "Created target
not present" when the field is absent. Added canAccessOpener: false
to every TargetInfo emitted by setDiscoverTargets, getTargets,
createTarget, attachToBrowserTarget, attachToTarget, and getTargetInfo.

PR #172: Added a cross-compile matrix entry for aarch64-unknown-linux-gnu
running on ubuntu-22.04 x86_64, producing obscura-aarch64-linux-cross.
This is a fallback for when GitHub ARM runners are unavailable without
removing the native ARM build.
This commit is contained in:
SGavrl committed 2026-05-24 15:22:30 +00:00
1 parent 1950048138
commit e0af9fc44f
2 files changed
+31

No files matched your search

+23
View File
@@ -20,18 +20,30 @@ jobs:
# newer glibc shipped by ubuntu-latest. # newer glibc shipped by ubuntu-latest.
os: ubuntu-22.04 os: ubuntu-22.04
name: obscura-x86_64-linux name: obscura-x86_64-linux
cross: false
- target: aarch64-unknown-linux-gnu - target: aarch64-unknown-linux-gnu
# Native build on GitHub's ARM runner.
os: ubuntu-22.04-arm os: ubuntu-22.04-arm
name: obscura-aarch64-linux name: obscura-aarch64-linux
cross: false
- target: aarch64-unknown-linux-gnu
# Cross-compile fallback from x86_64 Ubuntu 22.04. Same glibc
# 2.35 floor, useful when ARM runners are unavailable.
os: ubuntu-22.04
name: obscura-aarch64-linux-cross
cross: true
- target: aarch64-apple-darwin - target: aarch64-apple-darwin
os: macos-latest os: macos-latest
name: obscura-aarch64-macos name: obscura-aarch64-macos
cross: false
- target: x86_64-apple-darwin - target: x86_64-apple-darwin
os: macos-latest os: macos-latest
name: obscura-x86_64-macos name: obscura-x86_64-macos
cross: false
- target: x86_64-pc-windows-msvc - target: x86_64-pc-windows-msvc
os: windows-latest os: windows-latest
name: obscura-x86_64-windows name: obscura-x86_64-windows
cross: false
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@@ -42,6 +54,17 @@ jobs:
with: with:
targets: ${{ matrix.target }} targets: ${{ matrix.target }}
- name: Install cross-compilation toolchain (aarch64-linux)
if: matrix.cross == true
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
mkdir -p .cargo
cat >> .cargo/config.toml << 'CARGO_EOF'
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
CARGO_EOF
- name: Build - name: Build
run: cargo build --release --target ${{ matrix.target }} run: cargo build --release --target ${{ matrix.target }}
+8
View File
@@ -16,6 +16,7 @@ pub async fn handle(method: &str, params: &Value, ctx: &mut CdpContext) -> Resul
"title": "", "title": "",
"url": "", "url": "",
"attached": true, "attached": true,
"canAccessOpener": false,
"browserContextId": "", "browserContextId": "",
} }
}), }),
@@ -30,6 +31,7 @@ pub async fn handle(method: &str, params: &Value, ctx: &mut CdpContext) -> Resul
"title": page.title, "title": page.title,
"url": page.url_string(), "url": page.url_string(),
"attached": false, "attached": false,
"canAccessOpener": false,
"browserContextId": page.context.id, "browserContextId": page.context.id,
} }
}), }),
@@ -48,6 +50,7 @@ pub async fn handle(method: &str, params: &Value, ctx: &mut CdpContext) -> Resul
"title": page.title, "title": page.title,
"url": page.url_string(), "url": page.url_string(),
"attached": true, "attached": true,
"canAccessOpener": false,
"browserContextId": page.context.id, "browserContextId": page.context.id,
}) })
}) })
@@ -90,6 +93,7 @@ pub async fn handle(method: &str, params: &Value, ctx: &mut CdpContext) -> Resul
"title": page.title, "title": page.title,
"url": page.url_string(), "url": page.url_string(),
"attached": false, "attached": false,
"canAccessOpener": false,
"browserContextId": page.context.id, "browserContextId": page.context.id,
} }
}), }),
@@ -107,6 +111,7 @@ pub async fn handle(method: &str, params: &Value, ctx: &mut CdpContext) -> Resul
"title": page.title, "title": page.title,
"url": page.url_string(), "url": page.url_string(),
"attached": true, "attached": true,
"canAccessOpener": false,
"browserContextId": page.context.id, "browserContextId": page.context.id,
}, },
"waitingForDebugger": false, "waitingForDebugger": false,
@@ -133,6 +138,7 @@ pub async fn handle(method: &str, params: &Value, ctx: &mut CdpContext) -> Resul
"title": "", "title": "",
"url": "", "url": "",
"attached": true, "attached": true,
"canAccessOpener": false,
"browserContextId": "", "browserContextId": "",
}, },
"waitingForDebugger": false, "waitingForDebugger": false,
@@ -158,6 +164,7 @@ pub async fn handle(method: &str, params: &Value, ctx: &mut CdpContext) -> Resul
"title": page.title, "title": page.title,
"url": page.url_string(), "url": page.url_string(),
"attached": true, "attached": true,
"canAccessOpener": false,
"browserContextId": page.context.id, "browserContextId": page.context.id,
}, },
"waitingForDebugger": false, "waitingForDebugger": false,
@@ -211,6 +218,7 @@ pub async fn handle(method: &str, params: &Value, ctx: &mut CdpContext) -> Resul
"title": page.title, "title": page.title,
"url": page.url_string(), "url": page.url_string(),
"attached": true, "attached": true,
"canAccessOpener": false,
"browserContextId": page.context.id, "browserContextId": page.context.id,
} }
})) }))