From 9f4e595c7264a52ab85eb07c4d1411e4efb09ab1 Mon Sep 17 00:00:00 2001 From: Kuuuube <61125188+Kuuuube@users.noreply.github.com> Date: Thu, 20 Jun 2024 12:03:17 -0400 Subject: Fix settings display when shadow is on auto and body is light or dark (#1089) --- ext/js/pages/settings/popup-preview-controller.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ext/js/pages/settings') diff --git a/ext/js/pages/settings/popup-preview-controller.js b/ext/js/pages/settings/popup-preview-controller.js index 4a09d169..da163a6a 100644 --- a/ext/js/pages/settings/popup-preview-controller.js +++ b/ext/js/pages/settings/popup-preview-controller.js @@ -112,3 +112,11 @@ export class PopupPreviewController { this._frame.contentWindow.postMessage({action, params}, this._targetOrigin); } } + +/** + * @param {string | undefined} url + * @returns {boolean} + */ +export function checkPopupPreviewURL(url) { + return !!(url && url.includes('popup-preview.html') && !['http:', 'https:', 'ws:', 'wss:', 'ftp:', 'data:', 'file:'].includes(new URL(url).protocol)); +} -- cgit v1.2.3