MCPcopy
hub / github.com/philc/vimium / lookupEngine

Function lookupEngine

background_scripts/completion/search_wrapper.js:78–89  ·  view source on GitHub ↗
(searchUrl)

Source from the content-addressed store, hash-verified

76
77// Look up the completion engine for this searchUrl.
78function lookupEngine(searchUrl) {
79 if (engineCache.has(searchUrl)) {
80 return engineCache.get(searchUrl);
81 } else {
82 for (const engineClass of searchEngines.list) {
83 const engine = new engineClass();
84 if (engine.match(searchUrl)) {
85 return engineCache.set(searchUrl, engine);
86 }
87 }
88 }
89}
90
91// This is the main entry point.
92// - searchUrl is the search engine's URL, e.g. Settings.get("searchUrl"), or a custom search

Callers 1

completeFunction · 0.85

Calls 4

hasMethod · 0.80
getMethod · 0.80
matchMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected