@@ -60,9 +60,9 @@ export class Bing extends SearchingEngine {
6060 gotElement ( ) : Element {
6161 const container = document . createElement ( 'li' ) ;
6262 const asideElement = document . querySelector ( '#b_context' ) ;
63- console . log ( asideElement )
63+ console . log ( asideElement ) ;
6464 container . className = 'b_ans' ;
65-
65+
6666 asideElement ! . insertBefore ( container , asideElement ! . firstChild ) ;
6767 return container ;
6868 }
@@ -91,7 +91,6 @@ export class DuckDuckGo extends SearchingEngine {
9191
9292export class Yandex extends SearchingEngine {
9393 isMatch ( ) : boolean {
94-
9594 const match = window . location . hostname . match ( / y a n d e x \. ( c o m | r u ) $ / ) ;
9695 return ! ! match ;
9796 }
@@ -186,7 +185,6 @@ export class Baidu extends SearchingEngine {
186185 return null ;
187186 }
188187}
189-
190188export class Kagi extends SearchingEngine {
191189 isMatch ( ) : boolean {
192190 const match = window . location . hostname . match ( / k a g i \. c o m $ / g) ;
@@ -209,13 +207,37 @@ export class Kagi extends SearchingEngine {
209207 }
210208}
211209
210+ // todo try to support brave search but the CSP ban the inline sytle.
211+ // export class Brave extends SearchingEngine {
212+ // isMatch(): boolean {
213+ // const match = window.location.hostname.match(/search\.brave\.com$/g);
214+ // return !!match;
215+ // }
216+
217+ // getQuery(): string | null {
218+ // const searchUrl = new URL(window.location.href);
219+ // const query = searchUrl.searchParams.get('q');
220+
221+ // return query;
222+ // }
223+
224+ // gotElement(): Element {
225+ // const container = document.createElement('div');
226+ // const asideElement = document.querySelector('#side-right');
227+ // container.style.paddingTop = '20px';
228+ // asideElement!.insertBefore(container, asideElement!.firstChild);
229+ // return container;
230+ // }
231+ // }
232+
212233const searchEngins = [
213234 new Google ( ) ,
214235 new Bing ( ) ,
215236 new DuckDuckGo ( ) ,
216237 new Yandex ( ) ,
217238 new SearX ( ) ,
218239 new Kagi ( ) ,
240+ // new Brave(),
219241 new Baidu ( ) ,
220242] ;
221243
0 commit comments