openclaw/openclaw · error · Error

missing Chrome extension origin

Error message

missing Chrome extension origin

What it means

parseBrowserNativeHostOrigins requires exactly one chrome-extension:// caller origin that matches EXTENSION_ORIGIN_PATTERN. If no callerOrigin was captured (the loop found no chrome-extension:// argument) the pattern test on the empty string fails and throws.

Source

Thrown at extensions/browser/src/browser/extension-native-host.ts:60

  for (let index = 0; index < argv.length; index += 1) {
    const argument = argv[index];
    if (argument === "--expected-origin") {
      const value = argv[index + 1];
      if (!value || callerOrigin) {
        throw new Error("invalid expected-origin arguments");
      }
      expectedOrigins.push(value);
      index += 1;
    } else if (argument?.startsWith("chrome-extension://")) {
      if (callerOrigin) {
        throw new Error("multiple Chrome extension origins");
      }
      callerOrigin = argument;
    }
  }
  validateExpectedOrigins(expectedOrigins);
  if (!EXTENSION_ORIGIN_PATTERN.test(callerOrigin)) {
    throw new Error("missing Chrome extension origin");
  }
  return { expectedOrigins, callerOrigin };
}

async function validateOwnedFile(filePath: string, executable: boolean): Promise<string> {
  const resolved = path.resolve(filePath);
  const info = await fs.lstat(resolved);
  if (!info.isFile() || info.isSymbolicLink()) {
    throw new Error("unsafe file type");
  }
  if (process.platform !== "win32") {
    const uid = process.getuid?.();
    if (uid !== undefined && info.uid !== uid) {
      throw new Error("foreign file owner");
    }
    const mode = info.mode & 0o777;
    if ((mode & 0o077) !== 0 || (executable && (mode & 0o100) === 0)) {
      throw new Error("unsafe file mode");

View on GitHub (pinned to 01804a7531)

Solutions

  1. Ensure the launcher passes a chrome-extension://<32-char-id>/ caller origin argument.
  2. Regenerate the launcher via install.
  3. When testing manually, append a valid chrome-extension:// origin as the final argument.

Example fix

// before: no caller origin
parseBrowserNativeHostOrigins(["--expected-origin", "chrome-extension://abcdefghijklmnopqrstuvwxyz123456/"]);
// after: append the caller origin
parseBrowserNativeHostOrigins([
  "--expected-origin", "chrome-extension://abcdefghijklmnopqrstuvwxyz123456/",
  "chrome-extension://abcdefghijklmnopqrstuvwxyz123456/",
]);
Defensive patterns

Strategy: validation

Validate before calling

const EXTENSION_ORIGIN_PATTERN = /^chrome-extension:\/\/[a-p]{32}\/$/;
function hasCallerOrigin(argv: string[]): boolean {
  return argv.some((a) => typeof a === "string" && EXTENSION_ORIGIN_PATTERN.test(a));
}

Prevention

When it happens

Trigger: The native host argv has no argument starting with 'chrome-extension://', so callerOrigin stays empty and fails EXTENSION_ORIGIN_PATTERN.

Common situations: Chrome did not pass the caller origin (older runtime); a launcher script is missing the caller origin argument; testing the native host manually without appending a caller origin.

Related errors


AI-assisted analysis of openclaw/openclaw@01804a7531 (2026-08-12). Data as JSON: /api/errors/742b71e188c403a2. Report an issue: GitHub.