Cross-tab download queue, resolution pipeline, and immediate downloads for Brazen user scripts
Hindi dapat direktang i-install ang script na ito. Ito ay isang library para sa iba pang mga script na isasama sa meta directive. // @require https://update.greasyfork.org/scripts/587126/1876581/Brazen%20Framework%20-%20Download%20Manager.js
Optional module for cross-tab batch downloads, page resolution, and immediate
GM_download orchestration.
// @require ... Brazen Framework.js
// @require ... BrazenDownloadManager.js
this.configureDock({ orientations: ['right'], ... })
this.configureDownloadManager({
enableConfigKey: 'enable-download-manager',
downloadPaths: {
folderConfigKey: 'download-folder',
filenamePatternConfigKey: 'filename-pattern',
subfolderPatternConfigKey: 'subfolder-pattern',
defaultFolder: 'my-downloads',
getPatternResolver: () => ({ chips, tagTypes, ignore, substitutions, ... }),
extractMediaData: (el) => ({ id, md5, ext, ... }),
extractTagGroups: () => ({ author: [], character: [], ... }),
appendExtension: true,
nameFallback: (data) => data.id || 'media',
},
pages: {
search: { roles: ['selection'], itemSelector: 'span.thumb', resolveItem: (item) => ({ itemId, sourceUrl }) },
media: { roles: ['enqueueMedia', 'immediateDownload'] },
},
downloadTypes: {
post: {
resolveFromSearch: (ctx) => ({ nextUrl: ctx.sourceUrl }),
resolveFromMedia: (doc, ctx) => ({ mediaUrl, tagGroups, downloadId, data }),
},
},
resolutionInitiationGapMs: 2000,
downloadInitiationGapMs: 2000,
getQueueItemId: (ctx) => ctx.itemId,
})
this.getDownloadManager().downloadImmediate({
mediaElement: document.querySelector('#image'),
removeMediaOnSuccess: true,
})
BrazenFramework exposes downloadImmediate, enqueueDownload, isDownloadPageRole, etc.
Download path helpers moved from framework v12 — use getDownloadManager() for
buildDownloadPathFromPatterns and tag substitution helpers.