From 80016180b612718e7a73b6a24169e8ccfec5e166 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Fri, 1 Dec 2023 16:39:15 -0300 Subject: [PATCH] FixImagesQuality: no longer make gifs play when autoplay is off --- src/plugins/fixImagesQuality/index.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/fixImagesQuality/index.ts b/src/plugins/fixImagesQuality/index.ts index d94c8e3b..4acd9a92 100644 --- a/src/plugins/fixImagesQuality/index.ts +++ b/src/plugins/fixImagesQuality/index.ts @@ -14,10 +14,12 @@ export default definePlugin({ patches: [ { find: "handleImageLoad=", - replacement: { - match: /(?<=getSrc\(\i\){.+?format:)\i/, - replace: "null" - } + replacement: [ + { + match: /(?<=getSrc\(\i\){.+?return )\i\.SUPPORTS_WEBP.+?:(?=\i&&\(\i="png"\))/, + replace: "" + } + ] } ] });