"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.extractDefaultEnvironments = void 0;
async function extractDefaultEnvironments({ driver, }) {
    if (!driver)
        return [];
    const currentContext = driver.currentContext;
    try {
        const environment = await driver.getEnvironment();
        if (environment.isWeb) {
            const viewportSize = await driver.getViewportSize();
            return [{ name: 'chrome', ...viewportSize }];
        }
        else {
            return [];
        }
    }
    finally {
        await currentContext.focus();
    }
}
exports.extractDefaultEnvironments = extractDefaultEnvironments;
