返回博客
平台

在 macOS 和 Linux 上运行 Windows 浏览器配置

在 macOS 或 Linux 主机上运行 BotBrowser 时呈现 Windows 浏览器身份。

概述

许多生产环境部署在 Linux 服务器上,但需要呈现 Windows 桌面浏览器身份。BotBrowser 配置文件从特定平台的真实浏览器会话中捕获。在 macOS 或 Linux 上加载 Windows 配置文件时,所有与平台相关的信号都在引擎层面受到控制。

基本用法

# 在 macOS 或 Linux 上运行 Windows 11 Chrome 配置文件
chrome --bot-profile="/path/to/win11-chrome.enc" \
       --user-data-dir="$(mktemp -d)"

加载 Windows 配置文件后,所有信号对齐:navigator.platform 返回 "Win32",Sec-CH-UA-Platform 报告 "Windows",字体查询返回 Windows 字体可用性,渲染输出匹配 Windows 特征。

Puppeteer 示例

const puppeteer = require('puppeteer-core');

(async () => {
  const browser = await puppeteer.launch({
    executablePath: '/path/to/botbrowser/chrome',
    args: [
      '--bot-profile=/path/to/win11-chrome.enc',
      '--bot-config-timezone=America/Chicago',
      '--bot-config-locale=en-US',
    ],
    headless: true,
    defaultViewport: null,
  });

  const page = await browser.newPage();
  await page.goto('https://example.com');
  await browser.close();
})();

Linux 服务器 + Edge 配置文件

DISPLAY=:10.0 chrome \
  --bot-profile="/opt/profiles/win11-edge.enc" \
  --bot-config-browser-brand=edge \
  --proxy-server=socks5://user:pass@us-proxy:1080 \
  --bot-config-timezone=America/New_York \
  --bot-config-locale=en-US

选择合适的配置文件

配置文件与代理位置匹配。 对于美国和欧洲 IP,考虑到 Windows 的桌面市场份额,Windows 配置文件是最自然的选择。

使用当前版本。 Windows 10 和 11 配置文件最适合现代 Chrome 版本。

搭配正确的品牌。 Windows + Chrome 是全球最常见的组合,Windows + Edge 也非常普遍。

开始使用

  1. GitHub 下载 BotBrowser
  2. 从配置文件仓库选择 Windows 配置文件
  3. 在 macOS 或 Linux 主机上使用 --bot-profile 启动
  4. 验证平台一致性
#windows#macos#linux#cross-platform#profiles