MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / hookWS

Function hookWS

scripts/libs/ajax-hook/index.js:274–284  ·  view source on GitHub ↗
({ onBefore, onAfter, modifyUrl } = {})

Source from the content-addressed store, hash-verified

272
273// WARNING: experimental
274export function hookWS({ onBefore, onAfter, modifyUrl } = {}) {
275 if (!readyWs) {
276 initWS();
277 readyWs = true;
278 }
279 return hook([
280 { fn: modifyUrl, arr: modifyUrlWsFn },
281 { fn: onBefore, arr: onBeforeWSFn },
282 { fn: onAfter, arr: onAfterWSFn },
283 ]);
284}
285
286/* hookWS example
287hookWS({

Callers

nothing calls this directly

Calls 2

initWSFunction · 0.85
hookFunction · 0.70

Tested by

no test coverage detected