Skip to content

Commit d1c928a

Browse files
authored
Merge pull request #26 from howarddo2208/fix-duckduckgo-dark
fix: duckduckgo dark theme visibility
2 parents bab916c + 079b789 commit d1c928a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/pages/content/index.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { getLogseqCopliotConfig } from '@/config';
2+
import { fixDuckDuckGoDark } from '@/utils';
23
import { createRoot } from 'react-dom/client';
34
import Browser from 'webextension-polyfill';
45
import { LogseqCopliot } from './LogseqCopliot';
@@ -27,6 +28,10 @@ async function run(
2728
) {
2829
console.debug('Logseq copliot', window.location.hostname);
2930

31+
if (searchEngine instanceof DuckDuckGo) {
32+
fixDuckDuckGoDark()
33+
}
34+
3035
const query = searchEngine.getQuery();
3136
if (query) {
3237
console.log(`match ${typeof searchEngine}, query ${query}`);

src/utils.ts

+6
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,9 @@ export const buildTurndownService = () => {
8383

8484
return turndownService;
8585
};
86+
87+
export const fixDuckDuckGoDark = () => {
88+
if (document.querySelector('.dark-bg')) {
89+
document.body.style.color = 'var(--theme-col-txt-snippet)';
90+
}
91+
}

0 commit comments

Comments
 (0)