From 8b601215a0e816130183ef4c0e818f37c16d255a Mon Sep 17 00:00:00 2001 From: iorate <682043+iorate@users.noreply.github.com> Date: Sun, 16 Jun 2024 22:27:12 +0900 Subject: [PATCH] fix(ecosia): get dialog theme from background --- src/scripts/search-engines/ecosia.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/scripts/search-engines/ecosia.ts b/src/scripts/search-engines/ecosia.ts index 870650a1f..6cf7f8aaa 100644 --- a/src/scripts/search-engines/ecosia.ts +++ b/src/scripts/search-engines/ecosia.ts @@ -1,6 +1,6 @@ import { SEARCH_ENGINES } from "../../common/search-engines.ts"; import type { SearchEngine, SerpHandler } from "../types.ts"; -import { handleSerp } from "./helpers.ts"; +import { handleSerp, hasDarkBackground } from "./helpers.ts"; function getSerpHandler(): SerpHandler { return handleSerp({ @@ -46,6 +46,10 @@ function getSerpHandler(): SerpHandler { $site: "ecosia", $category: "web", }, + getDialogTheme: () => { + const layout = document.querySelector(".layout"); + return layout && hasDarkBackground(layout) ? "dark" : "light"; + }, }); }