One way to reduce the inconvenience of MediaViewer leaving extra history entries would be to not modify the URL bar at all.
See T64266 for motivation.
Version: unspecified
Severity: minor
See Also:
T64266: MultimediaViewer should not leave so many history entries when closed