web-monitoring-ui icon indicating copy to clipboard operation
web-monitoring-ui copied to clipboard

Use appropriate replay mode when loading resources from Wayback

Open Mr0grog opened this issue 8 months ago • 0 comments

When we rewrite resource URLs in pages or diffs to load things from archive.org instead of the live web, we currently always ask for unaltered (id_) versions of the resources:

https://github.com/edgi-govdata-archiving/web-monitoring-ui/blob/790e2a664c9aee5a9511b8327f200467e652c675/src/scripts/html-transforms.js#L121-L157

https://github.com/edgi-govdata-archiving/web-monitoring-ui/blob/790e2a664c9aee5a9511b8327f200467e652c675/src/scripts/html-transforms.js#L184-L191

Instead, we should ask for the appropriate mode based on how we’re using the resource: js_ for scripts, cs_ for stylesheets, and im_ for images. We should only fall back to id_ in cases where we don’t know what type to use.

Mr0grog avatar Mar 07 '25 01:03 Mr0grog