From 61e5278d8712a8f02ac0469864ae7a76074c4e7a Mon Sep 17 00:00:00 2001 From: justanotheranonymoususer Date: Sun, 19 Jul 2026 14:07:35 +0300 Subject: [PATCH 1/2] Fix style not applied if getItem throws --- src/dark-mode-toggle-stylesheets-loader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dark-mode-toggle-stylesheets-loader.js b/src/dark-mode-toggle-stylesheets-loader.js index cb052eb..6c4d2fa 100644 --- a/src/dark-mode-toggle-stylesheets-loader.js +++ b/src/dark-mode-toggle-stylesheets-loader.js @@ -44,7 +44,7 @@ try { mode = localStorage.getItem(STORAGE_NAME); } catch (e) { - return; + // Couldn't retrieve mode, user-agent-preferred style will be applied. } const lightCSSMediaRegex = /\(\s*prefers-color-scheme\s*:\s*light\s*\)/gi; From 0fa7385c7eab80ee0f8fd618bdb2f442b1075548 Mon Sep 17 00:00:00 2001 From: justanotheranonymoususer Date: Sun, 19 Jul 2026 14:09:32 +0300 Subject: [PATCH 2/2] Remove double license --- src/dark-mode-toggle-stylesheets-loader.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/dark-mode-toggle-stylesheets-loader.js b/src/dark-mode-toggle-stylesheets-loader.js index 6c4d2fa..cdb0477 100644 --- a/src/dark-mode-toggle-stylesheets-loader.js +++ b/src/dark-mode-toggle-stylesheets-loader.js @@ -14,23 +14,6 @@ * limitations under the License. */ -// @license © 2024 Google LLC. Licensed under the Apache License, Version 2.0. -/** - * Copyright 2024 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - // @license © 2024 Google LLC. Licensed under the Apache License, Version 2.0. (() => { const ELEMENT_ID = 'dark-mode-toggle-stylesheets';