2022-03-24 13:56:42 +00:00
|
|
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
|
|
|
|
|
|
export default function createManifest(
|
|
|
|
target: string,
|
|
|
|
): Record<string, unknown> {
|
|
|
|
const manifest: Record<string, unknown> = {
|
|
|
|
name: 'Queue',
|
|
|
|
description: 'A WebExtension for queueing links.',
|
2022-10-25 12:00:38 +00:00
|
|
|
version: '0.3.1',
|
2022-03-24 13:56:42 +00:00
|
|
|
permissions: ['contextMenus', 'storage'],
|
|
|
|
options_ui: {
|
|
|
|
page: 'options/index.html',
|
|
|
|
open_in_tab: true,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
const icons = {
|
|
|
|
128: 'assets/queue.png',
|
|
|
|
};
|
|
|
|
|
|
|
|
manifest.icons = icons;
|
|
|
|
|
|
|
|
const browserAction = {
|
|
|
|
default_icon: icons,
|
|
|
|
};
|
|
|
|
|
|
|
|
const backgroundScript = 'background-scripts/initialize.ts';
|
|
|
|
|
|
|
|
if (target === 'chromium') {
|
|
|
|
manifest.manifest_version = 3;
|
|
|
|
manifest.action = browserAction;
|
|
|
|
manifest.background = {
|
|
|
|
service_worker: backgroundScript,
|
|
|
|
type: 'module',
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
manifest.manifest_version = 2;
|
|
|
|
manifest.browser_action = browserAction;
|
|
|
|
manifest.background = {
|
|
|
|
scripts: [backgroundScript],
|
|
|
|
};
|
|
|
|
manifest.applications = {
|
|
|
|
gecko: {
|
|
|
|
id: '{c3560e6b-00e5-4ab3-b89e-8a54ee5b2c9f}',
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
return manifest;
|
|
|
|
}
|