diff --git a/src/operations/redirect-home-page-to-archive.ts b/src/operations/redirect-home-page-to-archive.ts index d40a6a2..fdf89eb 100644 --- a/src/operations/redirect-home-page-to-archive.ts +++ b/src/operations/redirect-home-page-to-archive.ts @@ -8,9 +8,8 @@ export default (e: { if (document.location.pathname === "/") { document.location.pathname = SITE.PATH.ARCHIVE; } else { - // Yes, this is repetitive. Yes, `Object.values` exists. But no, Userscripter (as of version 2.0.0) creates `e` with `Object.defineProperty` without the `enumerable` flag enabled, so `Object.values` returns the empty array. - (e.headerLogoLink as HTMLAnchorElement).href = SITE.PATH.ARCHIVE; - (e.latestNewsWidgetLink as HTMLAnchorElement).href = SITE.PATH.ARCHIVE; - (e.footerLogoLink as HTMLAnchorElement).href = SITE.PATH.ARCHIVE; + for (const link of Object.values(e)) { + (link as HTMLAnchorElement).href = SITE.PATH.ARCHIVE; + } } };