MCPcopy Create free account
hub / github.com/scriptscat/scriptcat / showAwaitingAction

Function showAwaitingAction

example/tests/gm_download_test.js:421–428  ·  view source on GitHub ↗

* Register an in-flight action button on the awaiting bar. * Use to expose things like "🛑 Abort download" while we wait for a verdict. * The button auto-hides when the verdict resolves (or the next showAwaiting() is called). * @param {string} label Button text. * @param {() => void} onC

(label, onClick)

Source from the content-addressed store, hash-verified

419 * @param {() => void} onClick Click handler. Stays attached until the bar hides.
420 */
421 function showAwaitingAction(label, onClick) {
422 $awaitingAction.textContent = label;
423 $awaitingAction.style.display = "";
424 $awaitingAction.onclick = (ev) => {
425 ev.preventDefault();
426 try { onClick(); } catch (e) { console.error("awaiting action handler threw:", e); }
427 };
428 }
429
430
431 // ---------- GM_download wrappers ----------

Callers 1

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected