One function

render_preview_html in ArchiveBox/abx-plugins

The author described this change as fix archivewebpage one-domain replay base. It counts as a record because the check below fails on the code as it stood at c9106f441 and passes on e7409f33a, with nothing else changed between the two runs.

Fix saved2026-06-04
Sharing licenceMIT · LICENSE
Change size+2 0

What the code was meant to do, written into the code itself as a docstring

Render the plugin's `full.html` template as the WACZ preview body. If a WACZ path is provided, the first archived URL from its pages index is used so replayweb.page can land directly in replay mode. Falls back to `fallback_url` (typically `Snapshot.url`) if the WACZ has no readable pages index.

The change

1717 if not archived_url:
1818 archived_url = fallback_url or ""
1919
20+ replay_base = _replay_base_for_output_path(output_path)
2021 archived_url_attr = (
2122 f'url="{html_escape(archived_url, quote=True)}"' if archived_url else ""
2223 )
3031 .replace("{{ output_path_raw }}", html_escape(filename, quote=True))
3132 .replace("{{ output_path }}", html_escape(output_path, quote=True))
3233 .replace("{{ archived_url }}", html_escape(archived_url, quote=True))
34+ .replace("{{ replay_base }}", html_escape(replay_base, quote=True))
3335 )

The check that tells the two apart

failpass·tests/test_archivewebpage_replay_preview.py::test_replay_preview_bootstrap_always_appends_ui_after_service_worker_wait

Check file tests/test_archivewebpage_replay_preview.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before itc9106f4410500ffad8f0d61738db9d1aeb0325ff
Broken version dated2026-06-04
Moduleabx_plugins.plugins.archivewebpage.replay_preview
Units changedrender_preview_html
Fingerprinted807d3de3288cc3
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.