Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/content/ContentHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import GoogleBot from './bot/GoogleBot';
import GoogleConsentBot from './bot/GoogleConsentBot';
import YahooConsentBot from './bot/YahooConsentBot';
import DuckDuckGoBot from './bot/DuckDuckGoBot';
import DuckDuckGoNoAIBot from './bot/DuckDuckGoNoAIBot';
import YandexBot from './bot/YandexBot';
import BingBot from './bot/BingBot';
import YahooBot from './bot/YahooBot';
Expand Down Expand Up @@ -77,8 +78,12 @@ export default class ContentHandler {
// otherwise default to google
if (this.debug) console.log('GoogleBot');
return GoogleBot;
}else if(str =='duckduckgo'){
if (this.debug) console.log('DuckDuckGoBot');
}else if(str == "duckduckgo") {
if (window.location.hostname == "noai.duckduckgo.com") {
if (this.debug) console.log("DuckDuckGoNoAIBot");
return DuckDuckGoNoAIBot;
}
if (this.debug) console.log("DuckDuckGoBot");
return DuckDuckGoBot;
}else if(str =='yandex'){
if (this.debug) console.log('YandexBot');
Expand Down
2 changes: 1 addition & 1 deletion src/content/bot/DuckDuckGoBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default class DuckDuckGoBot extends Bot{
}

get_search_input() {
return document.querySelector('#searchbox_input, input[name="q"], input[type="search"]');
return document.querySelector('#searchbox_homepage > div > textarea');
}

is_text_result_page(){
Expand Down
7 changes: 7 additions & 0 deletions src/content/bot/DuckDuckGoNoAIBot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import DuckDuckGoBot from "./DuckDuckGoBot";

export default class DuckDuckGoNoAIBot extends DuckDuckGoBot {
get_search_input() {
return document.querySelector('#searchbox_input, input[name="q"], input[type="search"]');
}
}