Skip to content

Commit 7aa26dd

Browse files
committed
feat: update Worker function to customize script name and improve DownloadURL handling
1 parent ad48037 commit 7aa26dd

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

builder/source/build-grouped-worker.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ type WorkerData = {
1212
export default async function Worker({ FileName, Domains }: { FileName: Set<string>, Domains: Set<string> }) {
1313
const WorkerData: WorkerData = Piscina.workerData as WorkerData
1414

15+
let DownloadURL = new URL(WorkerData.Config.SubscriptionUrl.replaceAll('/tinyShield.user.js', `/grouped/tinyShield-${[...FileName][0]}.user.js`))
16+
1517
const Banner = CreateBanner({
1618
Version: WorkerData.Config.Version!,
1719
BuildType: WorkerData.Config.BuildType ?? 'production',
1820
Domains: Domains,
19-
Name: 'tinyShield',
21+
Name: `tinyShield for Safari and ${[...FileName][0]}`,
2022
Namespace: 'https://github.com/FilteringDev/tinyShield',
21-
DownloadURL: new URL(WorkerData.Config.SubscriptionUrl),
22-
UpdateURL: new URL(WorkerData.Config.SubscriptionUrl),
23+
DownloadURL: DownloadURL,
24+
UpdateURL: DownloadURL,
2325
HomepageURL: new URL('https://github.com/FilteringDev/tinyShield'),
2426
SupportURL: new URL('https://github.com/FilteringDev/tinyShield/issues'),
2527
License: 'MPL-2.0',

0 commit comments

Comments
 (0)