Skip to main content
Version: 24.38.0

BrowserProvider.getExecutablePath() 方法

🌐 BrowserProvider.getExecutablePath() method

获取提取的归档文件中可执行文件的相对路径。

🌐 Get the relative path to the executable within the extracted archive.

语法

🌐 Signature

interface BrowserProvider {
getExecutablePath(options: {
browser: Browser;
buildId: string;
platform: BrowserPlatform;
}): Promise<string> | string;
}

参数

🌐 Parameters

范围

🌐 Parameter

类型

🌐 Type

描述

🌐 Description

options

{ browser: Browser; buildId: string; platform: BrowserPlatform; }

浏览器、构建ID和平台

🌐 Browser, buildId, and platform

返回:

Promise<string> | string

可执行文件的相对路径

🌐 Relative path to the executable

示例

🌐 Example

// Electron uses simple structure
getExecutablePath() {
return 'chromedriver/chromedriver';
}

// Custom provider with platform-specific paths
getExecutablePath(options) {
return `binaries/${options.browser}-${options.platform}`;
}