Source code
Revision control
Copy as Markdown
Other Tools
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
"use strict";
/**
* catalog.archives.gov - photos are displayed in reverse order
*
* The site calls Array.sort(() => 1), which is a strange choice, and leads to
* unspecified browser behavior. Firefox sorts in one way, other browsers do not.
* We can simply ignore that parameter to work around the issue.
*/
{
console.info(
);
const { prototype } = Array;
const oldSort = prototype.sort;
prototype.sort = function () {
if (
typeof arguments[0] == "function" &&
String(arguments[0]).includes(".objectType)?-1:1")
) {
return oldSort.call(this);
}
return oldSort.apply(this, arguments);
};
}