mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-07-04 19:05:12 +08:00
fix mounting failure caused by DuckDuckGo's initial rendering delay. #610
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { waitForElementToExistAndSelect } from '../../../utils/index.mjs'
|
||||
import { config } from '../index'
|
||||
|
||||
export default {
|
||||
init: async (hostname, userConfig) => {
|
||||
if (userConfig.insertAtTop) {
|
||||
return !!(await waitForElementToExistAndSelect(config.duckduckgo.resultsContainerQuery[0], 5))
|
||||
}
|
||||
return true
|
||||
},
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import stackoverflow from './stackoverflow'
|
||||
import juejin from './juejin'
|
||||
import weixin from './weixin'
|
||||
import followin from './followin'
|
||||
import duckduckgo from './duckduckgo'
|
||||
|
||||
/**
|
||||
* @typedef {object} SiteConfigAction
|
||||
@@ -55,6 +56,9 @@ export const config = {
|
||||
sidebarContainerQuery: ['.js-react-sidebar', '.react-results--sidebar'],
|
||||
appendContainerQuery: ['#links_wrapper'],
|
||||
resultsContainerQuery: ['.react-results--main'],
|
||||
action: {
|
||||
init: duckduckgo.init,
|
||||
},
|
||||
},
|
||||
startpage: {
|
||||
inputQuery: ["input[name='query']"],
|
||||
|
||||
Reference in New Issue
Block a user