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

Function get

background_scripts/completion/search_wrapper.js:57–75  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

55let requestId = 0;
56
57async function get(url) {
58 const timeoutDuration = 2500;
59 const controller = new AbortController();
60 let isError = false;
61 let responseText;
62 const timer = Utils.setTimeout(timeoutDuration, () => controller.abort());
63
64 try {
65 const response = await fetch(url, { signal: controller.signal });
66 responseText = await response.text();
67 } catch {
68 // Fetch throws an error if the network is unreachable, etc.
69 isError = true;
70 }
71
72 clearTimeout(timer);
73
74 return isError ? null : responseText;
75}
76
77// Look up the completion engine for this searchUrl.
78function lookupEngine(searchUrl) {

Callers 1

completeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected