From 03c289df3e59ec34d754ac55f86f21cf9e7d7558 Mon Sep 17 00:00:00 2001 From: jj Date: Mon, 5 Jan 2026 15:24:44 +0000 Subject: [PATCH] svc/ubo: add helium-specific assets overrides --- svc/ubo/assets.helium.json | 10 ++++++++++ svc/ubo/lib/ublock.ts | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 svc/ubo/assets.helium.json diff --git a/svc/ubo/assets.helium.json b/svc/ubo/assets.helium.json new file mode 100644 index 0000000..16f4e94 --- /dev/null +++ b/svc/ubo/assets.helium.json @@ -0,0 +1,10 @@ +{ + "adguard-ads": { "off": false }, + "adguard-spyware-url": { "off": false }, + "adguard-cookies": { "off": false }, + "fanboy-cookiemonster": { "off": false }, + "ublock-annoyances": { "off": false }, + "ublock-cookies-easylist": { "off": false }, + "easylist-notifications": { "off": false }, + "easylist-newsletters": { "off": false } +} diff --git a/svc/ubo/lib/ublock.ts b/svc/ubo/lib/ublock.ts index b0b0d42..a2fe4e7 100644 --- a/svc/ubo/lib/ublock.ts +++ b/svc/ubo/lib/ublock.ts @@ -2,6 +2,7 @@ import * as Util from './util.ts'; import * as Cache from './cache.ts'; import * as Allowlist from './allowlist.ts'; import { env } from './env.ts'; +import HeliumOverlay from '../assets.helium.json' with { type: 'json' }; import * as Path from '@std/path/posix'; @@ -15,6 +16,8 @@ type Asset = { title?: string; tags?: string; + off?: boolean; + updateAfter?: number; contentURL: string | string[]; cdnURLs?: string[]; @@ -23,6 +26,7 @@ type Asset = { type Filename = string; type AssetFile = Record; +type AssetPatch = Record>; const VERSION = '1.67.0'; const FILE_CHECKSUM = 'd532b5eb89271234760b6ad50fb26a79cbfe8a52ca5ff2cf0f5ea9aaa9d0ed3a'; @@ -41,12 +45,18 @@ const loadManifestFromGithub = async () => { const prepareAssetString = async () => { const manifest = await loadManifestFromGithub(); + const overlay: AssetPatch = HeliumOverlay; + const manifestId = 'assets.json'; const assetURLs: Record = {}; for (const [id, asset] of Object.entries(manifest)) { const allUrls = [asset.contentURL, asset.cdnURLs || []].flat(); + if (id in overlay) { + Object.assign(manifest[id], overlay[id]); + } + delete asset.cdnURLs; if (id === manifestId) {