mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-10-28 07:40:27 +01:00
e500088e65
Add Firefox data consent, repair contributor sign-in, and introduce optional Hide clutter buttons. Harden video navigation, voting, and action layouts with shared browser regression coverage and reproducible release packaging.
36 lines
1.4 KiB
JavaScript
36 lines
1.4 KiB
JavaScript
const path = require("node:path");
|
|
const { verifyRequestedExtensionArtifact } = require("./verify-extension-artifact");
|
|
|
|
const ALLOW_CUSTOM_ARTIFACT_ENV = "RYD_E2E_ALLOW_CUSTOM_EXTENSION_ARTIFACT";
|
|
const REPOSITORY_EXTENSION_ARTIFACT = path.resolve(__dirname, "../combined/dist/chrome");
|
|
|
|
function selectedArtifact(env) {
|
|
const requested = env.RYD_EXTENSION_ARTIFACT?.trim();
|
|
return requested ? path.resolve(requested) : REPOSITORY_EXTENSION_ARTIFACT;
|
|
}
|
|
|
|
function verifyPlaywrightExtensionArtifact({
|
|
env = process.env,
|
|
verifyArtifact = verifyRequestedExtensionArtifact,
|
|
} = {}) {
|
|
const artifact = selectedArtifact(env);
|
|
const custom = artifact !== REPOSITORY_EXTENSION_ARTIFACT;
|
|
if (custom && env[ALLOW_CUSTOM_ARTIFACT_ENV] !== "1") {
|
|
throw new Error(
|
|
`Refusing to run extension Playwright against custom artifact ${artifact}. ` +
|
|
`Set ${ALLOW_CUSTOM_ARTIFACT_ENV}=1 only for an intentional custom or negative-control fixture.`,
|
|
);
|
|
}
|
|
return verifyArtifact(custom ? artifact : undefined);
|
|
}
|
|
|
|
async function playwrightExtensionGlobalSetup() {
|
|
verifyPlaywrightExtensionArtifact();
|
|
}
|
|
|
|
module.exports = playwrightExtensionGlobalSetup;
|
|
module.exports.ALLOW_CUSTOM_ARTIFACT_ENV = ALLOW_CUSTOM_ARTIFACT_ENV;
|
|
module.exports.REPOSITORY_EXTENSION_ARTIFACT = REPOSITORY_EXTENSION_ARTIFACT;
|
|
module.exports.selectedArtifact = selectedArtifact;
|
|
module.exports.verifyPlaywrightExtensionArtifact = verifyPlaywrightExtensionArtifact;
|