From 346136ac8314ce5c8e4f06f55d642fee1e788a92 Mon Sep 17 00:00:00 2001 From: eltrac Date: Fri, 20 Feb 2026 11:48:14 +0800 Subject: perf: minify instantpage --- assets/js/instantpage.js | 452 ----------------------------------------- assets/js/instantpage.min.js | 2 + layouts/_partials/scripts.html | 2 +- 3 files changed, 3 insertions(+), 453 deletions(-) delete mode 100644 assets/js/instantpage.js create mode 100644 assets/js/instantpage.min.js diff --git a/assets/js/instantpage.js b/assets/js/instantpage.js deleted file mode 100644 index 60f1cb17..00000000 --- a/assets/js/instantpage.js +++ /dev/null @@ -1,452 +0,0 @@ -/*! instant.page v5.2.0 - (C) 2019-2025 Alexandre Dieulot - https://instant.page/license */ - -let _chromiumMajorVersionInUserAgent = null - , _speculationRulesType - , _allowQueryString - , _allowExternalLinks - , _useWhitelist - , _delayOnHover = 65 - , _lastTouchstartEvent - , _mouseoverTimer - , _preloadedList = new Set() - -init() - -function init() { - const supportChecksRelList = document.createElement('link').relList - - const supportsPrefetch = supportChecksRelList.supports('prefetch') - if (!supportsPrefetch) { - return - } - - const chromium100Check = 'throwIfAborted' in AbortSignal.prototype // Chromium 100+, Safari 15.4+, Firefox 97+ - const firefox115AndSafari17_0Check = supportChecksRelList.supports('modulepreload') // Firefox 115+, Safari 17.0+, Chromium 66+ - const safari15_4AndFirefox116Check = Intl.PluralRules && 'selectRange' in Intl.PluralRules.prototype // Safari 15.4+, Firefox 116+, Chromium 106+ - const firefox115AndSafari15_4Check = firefox115AndSafari17_0Check || safari15_4AndFirefox116Check - const isBrowserSupported = chromium100Check && firefox115AndSafari15_4Check - if (!isBrowserSupported) { - return - } - // In order to lessen maintenance and unnoticed bugs we only support: - // - Chromium ⩾ 100 — UC Browser 14 - // - Gecko as in Firefox ⩾ 115 — last version supported on Windows 7 - // - WebKit as in Safari ⩾ 15.4 — last major WebKit version supported on iPhone 6s & 7 - // - // WebKit doesn’t support prefetch anyway, but instant.page might - // eventually drop this requirement by providing an option for - // fetch()-based preloading. - // - // Additionally, instant.page should not cause JavaScript errors in: - // - Chromium ⩾ 61 - // - Gecko as in Firefox ⩾ 60 - // - WebKit as in Safari ⩾ 10.1 (iOS ⩾ 10.3 and macOS ⩾ 10.10) - // Browser engines older than that don’t support -- cgit v1.2.3