2 Commits
Author SHA1 Message Date
StanPonomarev 5aab284771 fix acutes
Release Firefox and Chromium extensions / Package and attach browser extensions (release) Successful in 6s
2026-08-31 22:20:56 +02:00
StanPonomarev 4d3401fa4c fix fonts
Release Firefox and Chromium extensions / Package and attach browser extensions (release) Successful in 4s
2026-08-30 21:38:00 +02:00
2 changed files with 39 additions and 0 deletions
+15
View File
@@ -192,6 +192,21 @@ async function packageExtension({
for (const relativePath of archiveFiles) { for (const relativePath of archiveFiles) {
let contents = await readFile(path.join(rootDirectory, relativePath)); let contents = await readFile(path.join(rootDirectory, relativePath));
if (target === "chromium" && relativePath === "content.css") {
contents = Buffer.from(
contents
.toString("utf8")
.replaceAll(
'url("fonts/',
'url("chrome-extension://__MSG_@@extension_id__/fonts/'
)
.replaceAll(
"unicode-range: U+2C00-2C5F;",
"unicode-range: U+0301, U+2C00-2C5F;"
)
);
}
if (relativePath === "manifest.json") { if (relativePath === "manifest.json") {
const manifest = createManifest(contents, version, target); const manifest = createManifest(contents, version, target);
contents = Buffer.from(`${JSON.stringify(manifest, null, 2)}\n`); contents = Buffer.from(`${JSON.stringify(manifest, null, 2)}\n`);
+24
View File
@@ -74,6 +74,10 @@ test("builds a deterministic unsigned XPI with the release version and runtime f
assert.equal(first.archiveName, "glagolify-9.8.7.xpi"); assert.equal(first.archiveName, "glagolify-9.8.7.xpi");
assert.deepEqual([...entries.keys()], [...FIREFOX_ARCHIVE_FILES]); assert.deepEqual([...entries.keys()], [...FIREFOX_ARCHIVE_FILES]);
assert.deepEqual(
entries.get("content.css"),
await readFile(path.join(rootDirectory, "content.css"))
);
const manifest = JSON.parse(entries.get("manifest.json")); const manifest = JSON.parse(entries.get("manifest.json"));
assert.equal(manifest.version, "9.8.7"); assert.equal(manifest.version, "9.8.7");
assert.equal(manifest.manifest_version, 2); assert.equal(manifest.manifest_version, 2);
@@ -127,6 +131,26 @@ test("builds a Chromium MV3 ZIP with Chromium manifest fields and raster icons",
]); ]);
assert.equal(manifest.icons["128"], "icons/icon-128.png"); assert.equal(manifest.icons["128"], "icons/icon-128.png");
const contentCss = entries.get("content.css").toString("utf8");
const fontUrls = [...contentCss.matchAll(/src: url\("([^"]+)"\)/g)].map(
(match) => match[1]
);
const extensionUrl = "chrome-extension://__MSG_@@extension_id__/";
assert.equal(fontUrls.length, 4);
for (const fontUrl of fontUrls) {
assert.equal(fontUrl.startsWith(extensionUrl), true);
const relativePath = fontUrl.slice(extensionUrl.length);
assert.equal(entries.has(relativePath), true);
assert.equal(
manifest.web_accessible_resources[0].resources.includes(relativePath),
true
);
}
assert.deepEqual(
[...contentCss.matchAll(/unicode-range: ([^;]+);/g)].map((match) => match[1]),
Array(4).fill("U+0301, U+2C00-2C5F")
);
for (const relativePath of CHROMIUM_ARCHIVE_FILES.filter((name) => for (const relativePath of CHROMIUM_ARCHIVE_FILES.filter((name) =>
name.endsWith(".png") name.endsWith(".png")
)) { )) {