playwright-core1.65.13.5 MB
Shown as plain text from the published tarball, after apm checked it against the version's checksum. Nothing in it runs on this page.
return profile;
}
return void 0;
}
async function listProfileDirectories(userDataDir) {
let entries;
try {
entries = await import_fs59.default.promises.readdir(userDataDir);
} catch {
return [];
}
const profiles = entries.filter((entry) => entry === "Default" || /^Profile \d+$/.test(entry));
profiles.sort((a, b) => profileRank(a) - profileRank(b));
return profiles;
}
function profileRank(profile) {
return profile === "Default" ? -1 : parseInt(profile.slice("Profile ".length), 10);
}
async function readLastUsedProfile(userDataDir) {
try {
const localState = JSON.parse(await import_fs59.default.promises.readFile(import_path52.default.join(userDataDir, "Local State"), "utf-8"));
const lastUsed = localState?.profile?.last_used;
return typeof lastUsed === "string" ? lastUsed : void 0;
} catch {
return void 0;
}
}
async function isPlaywrightExtensionInstalled(userDataDir) {
return await findPlaywrightExtensionProfile(userDataDir) !== void 0;
}
async function isExtensionInstalledInProfile(profileDir) {
if (await pathExists(import_path52.default.join(profileDir, "Extensions", playwrightExtensionId)))
return true;
for (const fileName of ["Preferences", "Secure Preferences"]) {
if (await hasExtensionSettingsRecord(import_path52.default.join(profileDir, fileName)))
return true;
}
return false;
}
async function hasExtensionSettingsRecord(prefsPath) {
let prefs;
This file is 3.5 MB, over the 1.0 MB the full view shows, so apm shows the lines around the cited one. Lines longer than 4 kB are cut.