Brazen Framework - Download Manager

Cross-tab download queue, resolution pipeline, and immediate downloads for Brazen user scripts

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/587126/1876581/Brazen%20Framework%20-%20Download%20Manager.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

Advertisement:

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Advertisement:

Author
brazenvoid
Version
1.0.0
Created
2026-07-15
Updated
2026-07-15
Size
50.1 KB
License
GPL-3.0-only

Brazen Framework - Download Manager

Optional module for cross-tab batch downloads, page resolution, and immediate GM_download orchestration.

Setup

// @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,
})

Immediate download

this.getDownloadManager().downloadImmediate({
  mediaElement: document.querySelector('#image'),
  removeMediaOnSuccess: true,
})

Framework delegation

BrazenFramework exposes downloadImmediate, enqueueDownload, isDownloadPageRole, etc. Download path helpers moved from framework v12 — use getDownloadManager() for buildDownloadPathFromPatterns and tag substitution helpers.