From 6a0a790e8f42c757bf89b5cbb941f4d1146e676d Mon Sep 17 00:00:00 2001 From: Nejc Habjan Date: Fri, 22 Nov 2024 14:24:58 +0100 Subject: [PATCH] Added preload hints in privacy plugin replacements (#7733) --- material/plugins/privacy/plugin.py | 4 ++-- src/plugins/privacy/plugin.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/material/plugins/privacy/plugin.py b/material/plugins/privacy/plugin.py index a180c57a2..aba2b8b29 100644 --- a/material/plugins/privacy/plugin.py +++ b/material/plugins/privacy/plugin.py @@ -302,8 +302,8 @@ class PrivacyPlugin(BasePlugin[PrivacyConfig]): if rel == "preconnect": return "" - # Replace external style sheet or favicon - if rel == "stylesheet" or rel == "icon": + # Replace external favicon, preload hint or style sheet + if rel in ("icon", "preload", "stylesheet"): file = self._queue(url, config) el.set("href", resolve(file)) diff --git a/src/plugins/privacy/plugin.py b/src/plugins/privacy/plugin.py index a180c57a2..aba2b8b29 100644 --- a/src/plugins/privacy/plugin.py +++ b/src/plugins/privacy/plugin.py @@ -302,8 +302,8 @@ class PrivacyPlugin(BasePlugin[PrivacyConfig]): if rel == "preconnect": return "" - # Replace external style sheet or favicon - if rel == "stylesheet" or rel == "icon": + # Replace external favicon, preload hint or style sheet + if rel in ("icon", "preload", "stylesheet"): file = self._queue(url, config) el.set("href", resolve(file))