Compare commits
No commits in common. "639d2b4462173532cd65cd88199514b93f19197b" and "4eb9e911bec62961de6f2b4aeb79757c6146304e" have entirely different histories.
639d2b4462
...
4eb9e911be
|
@ -2,9 +2,7 @@
|
||||||
|
|
||||||
> A WebExtension for queueing links.
|
> A WebExtension for queueing links.
|
||||||
|
|
||||||
[![Get Queue for Firefox](./images/mozilla-addons.png)](https://addons.mozilla.org/firefox/addon/holllo-queue)
|
[![Queue on AMO](https://img.shields.io/amo/v/holllo-queue)](https://addons.mozilla.org/firefox/addon/holllo-queue)
|
||||||
[![Get Queue for Chrome](./images/chrome-web-store.png)](https://chrome.google.com/webstore/detail/queue/epnbikemcmienphlfmidkimpjnmohcbl)
|
|
||||||
[![Get Queue for Edge](./images/microsoft.png)](https://microsoftedge.microsoft.com/addons/detail/queue/aanjampfdpcnhoeglmfefmmegdbifaak)
|
|
||||||
|
|
||||||
![Queue 0.2.2](./images/queue-version-0-2-2.png)
|
![Queue 0.2.2](./images/queue-version-0-2-2.png)
|
||||||
|
|
||||||
|
@ -16,9 +14,10 @@ Want to find out more about Queue? Check out [the wiki].
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
You can install Queue through the stores linked above, [installing from a file] (see [the Releases page] for a prebuilt version) or building [from source](#development).
|
You can install Queue through [Mozilla Addons], [installing from a file] (see [the Releases page] for a prebuilt version) or building [from source](#development).
|
||||||
|
|
||||||
[installing from a file]: https://support.mozilla.org/en-US/kb/find-and-install-add-ons-add-features-to-firefox#w_how-do-i-find-and-install-add-ons
|
[installing from a file]: https://support.mozilla.org/en-US/kb/find-and-install-add-ons-add-features-to-firefox#w_how-do-i-find-and-install-add-ons
|
||||||
|
[Mozilla Addons]: https://addons.mozilla.org/firefox/addon/holllo-queue/
|
||||||
[the Releases page]: https://github.com/Holllo/queue/releases
|
[the Releases page]: https://github.com/Holllo/queue/releases
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 3.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 18 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.3 KiB |
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
"manifest_version": 3,
|
||||||
|
"name": "Queue",
|
||||||
|
"description": "A WebExtension for queueing links.",
|
||||||
|
"permissions": [
|
||||||
|
"contextMenus",
|
||||||
|
"storage",
|
||||||
|
"tabs"
|
||||||
|
],
|
||||||
|
"icons": {
|
||||||
|
"128": "assets/queue.png"
|
||||||
|
},
|
||||||
|
"action": {
|
||||||
|
"default_icon": {
|
||||||
|
"128": "assets/queue.png"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"options_ui": {
|
||||||
|
"page": "options/index.html",
|
||||||
|
"open_in_tab": true
|
||||||
|
},
|
||||||
|
"background": {
|
||||||
|
"service_worker": "background-scripts/initialize.ts",
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
{
|
||||||
|
"manifest_version": 2,
|
||||||
|
"name": "Queue",
|
||||||
|
"description": "A WebExtension for queueing links.",
|
||||||
|
"permissions": [
|
||||||
|
"contextMenus",
|
||||||
|
"storage",
|
||||||
|
"tabs"
|
||||||
|
],
|
||||||
|
"content_security_policy": "script-src 'self'; object-src 'self'; style-src 'unsafe-inline'",
|
||||||
|
"web_accessible_resources": [
|
||||||
|
"assets/**"
|
||||||
|
],
|
||||||
|
"icons": {
|
||||||
|
"128": "assets/queue.png"
|
||||||
|
},
|
||||||
|
"browser_action": {
|
||||||
|
"default_icon": {
|
||||||
|
"128": "assets/queue.png"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"options_ui": {
|
||||||
|
"page": "options/index.html",
|
||||||
|
"open_in_tab": true
|
||||||
|
},
|
||||||
|
"background": {
|
||||||
|
"scripts": [
|
||||||
|
"background-scripts/initialize.ts"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"applications": {
|
||||||
|
"gecko": {
|
||||||
|
"id": "{c3560e6b-00e5-4ab3-b89e-8a54ee5b2c9f}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,50 +0,0 @@
|
||||||
/* 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.',
|
|
||||||
version: '0.2.6',
|
|
||||||
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;
|
|
||||||
}
|
|
|
@ -1,4 +1,5 @@
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
|
import fsp from 'node:fs/promises';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import process from 'node:process';
|
import process from 'node:process';
|
||||||
import url from 'node:url';
|
import url from 'node:url';
|
||||||
|
@ -9,35 +10,41 @@ import {defineConfig} from 'vite';
|
||||||
import preactPreset from '@preact/preset-vite';
|
import preactPreset from '@preact/preset-vite';
|
||||||
import webExtension from 'vite-plugin-web-extension';
|
import webExtension from 'vite-plugin-web-extension';
|
||||||
|
|
||||||
import createManifest from './source/manifest.js';
|
const currentDir = path.dirname(url.fileURLToPath(import.meta.url));
|
||||||
|
const sourceDir = path.join(currentDir, 'source');
|
||||||
|
|
||||||
|
const queueVersion = '0.2.5';
|
||||||
|
|
||||||
const targetBrowser = process.env.VITE_BROWSER ?? 'firefox';
|
const targetBrowser = process.env.VITE_BROWSER ?? 'firefox';
|
||||||
process.env.VITE_BROWSER = targetBrowser;
|
process.env.VITE_BROWSER = targetBrowser;
|
||||||
|
|
||||||
const currentDir = path.dirname(url.fileURLToPath(import.meta.url));
|
let webExtConfig;
|
||||||
const buildDir = path.join(currentDir, 'build', targetBrowser);
|
|
||||||
const sourceDir = path.join(currentDir, 'source');
|
|
||||||
|
|
||||||
fs.mkdirSync(path.join(currentDir, targetBrowser), {recursive: true});
|
|
||||||
|
|
||||||
const webExtConfig: Record<string, unknown> = {
|
|
||||||
browserConsole: true,
|
|
||||||
chromiumProfile: 'chromium/',
|
|
||||||
firefoxProfile: 'firefox/',
|
|
||||||
keepProfileChanges: true,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (targetBrowser === 'chromium') {
|
if (targetBrowser === 'chromium') {
|
||||||
webExtConfig.startUrl = 'chrome://extensions/';
|
fs.mkdirSync(path.join(currentDir, 'chromium'), {recursive: true});
|
||||||
webExtConfig.target = 'chromium';
|
webExtConfig = {
|
||||||
|
browserConsole: true,
|
||||||
|
chromiumProfile: 'chromium/',
|
||||||
|
keepProfileChanges: true,
|
||||||
|
startUrl: 'chrome://extensions/',
|
||||||
|
target: 'chromium',
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
webExtConfig.startUrl = 'about:debugging#/runtime/this-firefox';
|
fs.mkdirSync(path.join(currentDir, 'firefox'), {recursive: true});
|
||||||
webExtConfig.target = 'firefox-desktop';
|
webExtConfig = {
|
||||||
|
browserConsole: true,
|
||||||
|
firefoxProfile: 'firefox/',
|
||||||
|
keepProfileChanges: true,
|
||||||
|
startUrl: 'about:debugging#/runtime/this-firefox',
|
||||||
|
target: 'firefox-desktop',
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const buildDir = path.join(currentDir, 'build', targetBrowser);
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
build: {
|
build: {
|
||||||
minify: false,
|
minify: true,
|
||||||
outDir: buildDir,
|
outDir: buildDir,
|
||||||
sourcemap: 'inline',
|
sourcemap: 'inline',
|
||||||
},
|
},
|
||||||
|
@ -48,7 +55,19 @@ export default defineConfig({
|
||||||
webExtension({
|
webExtension({
|
||||||
assets: 'assets',
|
assets: 'assets',
|
||||||
browser: targetBrowser,
|
browser: targetBrowser,
|
||||||
manifest: () => createManifest(targetBrowser),
|
async manifest() {
|
||||||
|
const manifest = JSON.parse(
|
||||||
|
await fsp.readFile(
|
||||||
|
path.join(sourceDir, `${targetBrowser}-manifest.json`),
|
||||||
|
// eslint-disable-next-line unicorn/prefer-json-parse-buffer
|
||||||
|
'utf-8',
|
||||||
|
),
|
||||||
|
) as Record<string, unknown>;
|
||||||
|
|
||||||
|
manifest.version = queueVersion;
|
||||||
|
|
||||||
|
return manifest;
|
||||||
|
},
|
||||||
webExtConfig,
|
webExtConfig,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue