[eric] windows 1.1.56 hotfix: webRequest.onHeadersReceived filter uses 'subFrame' (Electron camelCase) not 'sub_frame' (Chrome extension snake_case) — wrong name threw "Invalid type sub_frame" synchronously during app.whenReady, became an unhandledRejection, prevented the app from booting on 1.1.55

This commit is contained in:
Eric
2026-05-25 22:51:34 -07:00
parent b73f508755
commit 0076909145
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -1105,7 +1105,8 @@ app.whenReady().then(async () => {
// Strip X-Frame-Options and CSP frame-ancestors directives on iframe subframe loads so the Windows BrowserCard iframe fallback (used because <webview> tag commit segfaults on Chromium 144 + this Electron 40 CastLabs build) can render sites that normally refuse to be embedded. Scoped to types:['sub_frame'] so OAuth popups, the main app frame, deep-link redirects, and DRM license fetches keep their security headers intact. urls filter limits to http/https so file:// loads of the bundled frontend are untouched.
session.defaultSession.webRequest.onHeadersReceived(
{ urls: ['http://*/*', 'https://*/*'], types: ['sub_frame'] },
// Electron's webRequest type name for iframes is 'subFrame' (camelCase), not the Chrome-extension 'sub_frame' — passing the wrong name throws "Invalid type sub_frame" synchronously which becomes an unhandledRejection and prevents the app from booting.
{ urls: ['http://*/*', 'https://*/*'], types: ['subFrame'] },
(details, callback) => {
const headers = { ...(details.responseHeaders || {}) };
for (const k of Object.keys(headers)) {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "openswarm",
"version": "1.1.55",
"version": "1.1.56",
"description": "OpenSwarm — AI Agent Orchestrator",
"author": "openswarm-ai",
"main": "main.js",