Skip to content

Support the demo's milkdropPresetUrl query param - #1390

Open
captbaritone wants to merge 1 commit into
masterfrom
demo-milkdrop-preset-url
Open

captbaritone wants to merge 1 commit into
masterfrom
demo-milkdrop-preset-url

Conversation

@captbaritone

Copy link
Copy Markdown
Owner

Links of the form webamp.org/?milkdropPresetUrl=https://archive.org/cors/md_….milk/….milk fail: getPresets threw Error: We still need to implement this, so the Milkdrop window opens with no presets. In Sentry this is WEBAMP-1P0, 186 events, and every event since November 2 has an archive.org md_ URL. Something is linking to webamp.org with these.

This implements the param. It fetches the .milk file and converts it with milkdrop-preset-converter-aws and the shader-converter endpoint, the same path the demo already uses for .milk files dropped onto Milkdrop. Conversion is lazy (getButterchrunPresetObject), so the converter chunk only loads when the preset is used.

As with butterchurnPresetUrl and butterchurnPresetMapUrl, only known URLs are accepted, because a converted preset contains code that is run. The allowlist is https://archive.org/cors/md_….milk, which mirrors the archive.org md_….json entry already in the list. Any other URL logs Unsupported URL passed as milkdropPresetUrl query param. and falls back to the default presets. That is the same thing the other params do.

importConvertPreset and the converter endpoint move to module-level constants, so butterchurnOptions and the new loader share them.

Steps to reproduce (on webamp.org today)

  1. Open https://webamp.org/?milkdropPresetUrl=https://archive.org/cors/md_bdrv_al_Eo.S.Phat_intergalactic_blob_analyser.milk/bdrv__al_Eo.S.Phat_intergalactic_blob_analyser.milk (the URL from the latest Sentry event).
  2. Expected: Milkdrop shows that preset. Actual: the console shows Error: We still need to implement this and Milkdrop has no presets.

Test plan

  • Opened the URL above against the dev server. The preset is fetched, converted and selected: the store has a single RESOLVED preset with warp and comp shaders, it renders once a track plays, and the console has no errors.
  • After deploy, open the URL above on webamp.org and check that the preset renders.
  • Open /?milkdropPresetUrl=https://example.com/foo.milk and check that it logs the "Unsupported URL" error and loads the default presets.
  • eslint and prettier --check pass. The demo's tsc errors are unchanged: the two existing PNG-import errors in DemoDesktop.tsx.

🤖 Generated with Claude Code

?milkdropPresetUrl= threw "We still need to implement this". Fetch the
.milk file and convert it with the preset converter the demo already uses
for dropped .milk files. Like the other preset URL params, only known
hosts are accepted: archive.org's md_ items, which already appear in the
allowlist for .json presets.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Size Change: 0 B

Total Size: 491 kB

ℹ️ View Unchanged
Filename Size
packages/webamp/built/webamp.bundle.min.js 298 kB
packages/webamp/built/webamp.lazy-bundle.min.js 193 kB

compressed-size-action

@netlify

netlify Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for tourmaline-kringle-c98715 canceled.

Name Link
🔨 Latest commit 1c4822c
🔍 Latest deploy log https://app.netlify.com/projects/tourmaline-kringle-c98715/deploys/6afa5367869ca11e8b12d864

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant