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"; + }, }); }