mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-07-23 12:50:47 +08:00
upgrade component mount for brave search
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { waitForElementToExistAndSelect } from '../../../utils'
|
||||
import { config } from '../index.mjs'
|
||||
|
||||
export default {
|
||||
init: async (hostname, userConfig) => {
|
||||
const selector = userConfig.insertAtTop
|
||||
? config.brave.resultsContainerQuery[0]
|
||||
: config.brave.sidebarContainerQuery[0]
|
||||
await waitForElementToExistAndSelect(selector, 5)
|
||||
return true
|
||||
},
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import juejin from './juejin'
|
||||
import weixin from './weixin'
|
||||
import followin from './followin'
|
||||
import duckduckgo from './duckduckgo'
|
||||
import brave from './brave'
|
||||
|
||||
/**
|
||||
* @typedef {object} SiteConfigAction
|
||||
@@ -98,6 +99,9 @@ export const config = {
|
||||
sidebarContainerQuery: ['.sidebar'],
|
||||
appendContainerQuery: [],
|
||||
resultsContainerQuery: ['#results'],
|
||||
action: {
|
||||
init: brave.init,
|
||||
},
|
||||
},
|
||||
searx: {
|
||||
inputQuery: ["input[name='q']"],
|
||||
|
||||
Reference in New Issue
Block a user