MCPcopy Index your code
hub / github.com/ZToolsCenter/ZTools / handleDynamicWebSearch

Function handleDynamicWebSearch

src/main/api/renderer/systemCommands.ts:275–289  ·  view source on GitHub ↗
(
  ctx: SystemCommandContext,
  param: any,
  featureCode: string
)

Source from the content-addressed store, hash-verified

273}
274
275async function handleDynamicWebSearch(
276 ctx: SystemCommandContext,
277 param: any,
278 featureCode: string
279): Promise<any> {
280 console.log('[SystemCmd] 执行网页快开搜索:', featureCode, param)
281 const engine = await webSearchAPI.getEngineByFeatureCode(featureCode)
282 if (!engine) {
283 return { success: false, error: '未找到搜索引擎配置' }
284 }
285 if (engine.type === 'webpage') {
286 return handleOpenWebpage(ctx, engine.url, engine.name)
287 }
288 return handleWebSearch(ctx, param, engine.url, engine.name)
289}
290
291async function handleOpenWebpage(
292 ctx: SystemCommandContext,

Callers 1

executeSystemCommandFunction · 0.85

Calls 3

handleOpenWebpageFunction · 0.85
handleWebSearchFunction · 0.85

Tested by

no test coverage detected