JavaScript aggregation script backport